Part Number Hot Search : 
DSP56858 MB89P AKD46 ZVN4310A BL0202C ADA4899 D2N201LD MOC3021M
Product Description
Full Text Search
 

To Download UPD17072GB-XXX-1A7 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  description m pd17072 and 17073 are low-voltage 4-bit single-chip cmos microcontrollers containing hardware ideal for organizing a digital tuning system. the cpu employs 17k architecture and can manipulate the data memory directly, perform arithmetic operations, and control peripheral hardware with a single instruction. all the instructions are 16-bit one-word instructions. as peripheral hardware, a prescaler that can operate at up to 230 mhz for a digital tuning system, a pll frequency synthesizer, and an intermediate frequency (if) counter are integrated in addition to i/o ports, an lcd controller/driver, a/d converter, and beep. therefore, a high-performance, multi-function digital tuning system can be configured with a single chip of m pd17072 or 17073. because the m pd17072 and 17073 can operate at low voltage (v dd = 1.8 to 3.6 v), they are ideal for controlling battery-cell driven portable devices such as portable radio equipment, headphone stereos, or radio cassette recorders. features ? 17k architecture: general-purpose register system ? program memory (rom) 6 kb (3072 16 bits): m pd17072 8 kb (4096 16 bits): m pd17073 ? general-purpose data memory (ram) 176 4 bits ? instruction execution time 53.3 m s (with 75-khz crystal resonator: normal operation) 106.6 m s (with 75-khz crystal resonator: low-speed mode) ? decimal operation ? table reference ? hardware for pll frequency synthesizer dual modulus prescaler (230 mhz max.), programmable divider, phase comparator, charge pump ? various peripheral hardware general-purpose i/o ports, lcd controller/driver, serial interface, a/d converter, beep, intermediate frequency (if) counter ? many interrupts external: 1 channel internal: 2 channels ? power-on reset, ce reset, and power failure detector ? cmos low power consumption ? supply voltage: v dd = 1.8 to 3.6 v unless otherwise stated, the m pd17073 is taken as a representative product in this document. 4-bit single-chip microcontroller with hardware for digital tuning system m pd17072,17073 mos integrated circuit document no. u11450ej1v0ds00 (1st edition) date published september 1996 p printed in japan the information in this document is subject to change without notice. 1996 data sheet
m pd17072,17073 2 ordering information part number package m pd17072gb- -1a7 56-pin plastic qfp (10 10 mm, 0.65-mm pitch) m pd17072gb- -9eu 64-pin plastic tqfp (fine pitch) (10 10 mm, 0.5-mm pitch) m pd17073gb- -1a7 56-pin plastic qfp (10 10 mm, 0.65-mm pitch) m pd17073gb- -9eu 64-pin plastic tqfp (fine pitch) (10 10 mm, 0.5-mm pitch) remark is a rom code number.
3 m pd17072,17073 item function program memory (rom) ? 6k bytes (3072 16 bits): m pd17072 ? 8k bytes (4096 16 bits): m pd17073 ? table reference area: 4096 16 bits general-purpose data memory ? 176 4 bits (ram) general-purpose register: 16 4 bits (fixed at 00h through 0fh of bank0, shared with data buffers.) lcd segment register 15 4 bits peripheral control register 32 4 bits instruction execution time ? 53.3 m s (with 75-khz crystal resonator: normal operation) ? 106.6 m s (with 75-khz crystal resonator: low-speed mode) selectable by software stack level ? address stack: 2 levels (stack can be manipulated) ? interrupt stack: 1 level (stack cannot be manipulated) general-purpose port ? i/o port: 8 ? input port: 4 ? output port: 9 beep ? 1 type ? selectable frequency (1.5 khz, 3 khz) lcd controller/driver ? 15 segments, 4 commons 1/4 duty, 1/2 bias, frame frequency of 62.5 hz, drive voltage v lcd1 = 3.1 v (typ.) serial interface ? 1 channel (serial i/o mode) 3-wire/2-wire mode selectable a/d converter 4 bits 2 channels (successive approximation via software) interrupt ? 3 channels (maskable interrupt) external interrupt: 1 (int pin) internal interrupt: 2 (basic timer 1, serial interface) timer ? 2 channels basic timer 0: 125 ms basic timer 1: 8 ms, 32 ms reset ? power-on reset (on power application) ? reset by ce pin (ce pin: low level ? high level) ? power failure detection function pll division method ? direct division method (vcol pin: 8 mhz max.) frequency ? pulse swallow method (vcol pin: 55 mhz max.) synthesizer (vcoh pin: 230 mhz max.) reference ? 6 types selectable by program frequency 1, 3, 5, 6.25, 12.5, 25 khz charge pump error out output: 1 line (eo pin) phase comparator unlock detectable by program frequency counter ? frequency measurement p0d3/fmifc/amifc pin: fmif mode, 10 to 11 mhz p0d3/fmifc/amifc pin: amif mode 400 to 500 khz p0d2/amifc pin supply voltage v dd = 1.8 to 3.6 v package ? 56-pin plastic qfp (10 10 mm, 0.65-mm pitch) ? 64-pin plastic tqfp (10 10 mm, 0.5-mm pitch) function outline
m pd17072,17073 4 block diagram port p0a0-p0a3 p0b0-p0b3 p0c0, p0c1 p0d2, p0d3 p1a0-p1a3 p1b0-p1b3 p1c0 reg lcd 0 reg lcd 1 cap lcd 0 cap lcd 1 com0 com3 lcd0 lcd14 x in x out reg1 voltage doubler lcd controller /driver osc xtal voltage regulator cpu peripheral ram 176 4 bits system reg. alu instruction decoder rom 3072 16 bits ( pd17072) 4096 16 bits ( pd17073) program counter 12 bits stack 2 12 bits serial interface beep interrupt controller basic timer0 basic timer1 a/d converter frequency counter pll pll voltage regulator reset sck/p0b2 si/so1/p0b3 so0/p1c0 beep int ad0/p1a2 ad1/p1a3 fmifc/amifc/p0d3 amifc/p0d2 eo vcoh vcol reg0 v dd ce gnd m m
5 m pd17072,17073 pin configuration (top view) 56-pin plastic qfp (10 10 mm) m pd17072gb- -1a7 m pd17073gb- -1a7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 42 41 40 39 38 37 36 35 34 33 32 31 30 29 15 16 17 18 19 20 21 22 23 24 25 26 27 28 56 55 54 53 52 51 50 49 48 47 46 45 44 43 p1c0/so0 p0a0 p0a1 p0a2 p0a3 p1b0 p1b1 p1b2 p1b3 p1a0 p1a1 p1a2/ad0 p1a3/ad1 p0c0 lcd7 lcd6 lcd5 lcd4 lcd3 lcd2 lcd1 lcd0 com3 com2 com1 com0 reg lcd 1 cap lcd 1 p0b3/si/so1 p0b2/sck p0b1 p0b0 beep int ce lcd14 lcd13 lcd12 lcd11 lcd10 lcd9 lcd8 p0c1 p0d2/amifc p0d3/fmifc/amifc gnd eo vcol vcoh reg0 v dd x out x in reg1 reg lcd 0 cap lcd 0
m pd17072,17073 6 64-pin plastic tqfp (fine pitch) (10 10 mm) m pd17072gb- -9eu m pd17073gb- -9eu 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 p1c0/so0 p0a0 p0a1 p0a2 nc p0a3 p1b0 p1b1 p1b2 p1b3 p1a0 nc p1a1 p1a2/ad0 p1a3/ad1 p0c0 lcd7 lcd6 lcd5 nc lcd4 lcd3 lcd2 lcd1 lcd0 com3 nc com2 com1 com0 reg lcd 1 cap lcd 1 p0b3/si/so1 p0b2/sck p0b1 p0b0 beep nc int ce lcd14 lcd13 nc lcd12 lcd11 lcd10 lcd9 lcd8 p0c1 p0d2/amifc p0d3/fmifc/amifc gnd gnd eo vcol vcoh reg0 v dd v dd x out x in reg1 reg lcd 0 cap lcd 0
7 m pd17072,17073 pin identification ad0, ad1 : a/d converter input amifc : intermediate frequency (if) counter input beep : beep output cap cld 0, cap lcd 1 : capacitor connection for lcd drive voltage ce : chip enable com0-com2 : lcd common signal output eo : error out fmifc : intermediate frequency (if) counter input gnd : ground int : external interrupt request signal input lcd0-lcd14 : lcd segment signal output nc : no connection p0a0-p0a3 : port 0a p0b0-p0b3 : port 0b p0c0, p0c1 : port 0c p0d2, p0d3 : port 0d p1a0-p1a3 : port 1a p1b0-p1b3 : port 1b p1c0 : port 1c reg lcd 0, reg lcd 1 : lcd drive voltage reg0 : pll voltage regulator reg1 : oscillation circuit voltage regulator sck : serial clock i/o si : serial data input so0, so1 : serial data output vcol : local oscillator input vcoh : local oscillator input v dd : positive power supply x in , x out : crystal resonator connection pins
m pd17072,17073 8 contents 1. pin function ............................................................................................................................... ... 12 1.1 pin function list ............................................................................................................................... ....... 12 1.2 equivalent circuits of pins ....................................................................................................................... 15 1.3 processing of unused pins ..................................................................................................................... 18 1.4 notes on using ce pin ............................................................................................................................ 19 2. program memory (rom) ........................................................................................................... 20 2.1 general ............................................................................................................................... ...................... 20 2.2 program memory ............................................................................................................................... ...... 21 2.3 program counter ............................................................................................................................... ....... 21 2.4 execution flow of program memory ....................................................................................................... 22 2.5 notes on using program memory ........................................................................................................... 22 3. address stack (ask) ................................................................................................................. 23 3.1 general ............................................................................................................................... ...................... 23 3.2 address stack register (asr) ................................................................................................................ 23 3.3 stack pointer (sp) ............................................................................................................................... .... 24 3.4 operations of address stack ................................................................................................................... 25 3.5 notes on using address stack ................................................................................................................ 25 4. data memory (ram) ..................................................................................................................... 26 4.1 general ............................................................................................................................... ...................... 26 4.2 configuration and function of data memory .......................................................................................... 27 4.3 addressing data memory ........................................................................................................................ 30 4.4 notes on using data memory ................................................................................................................. 31 5. system register (sysreg) ...................................................................................................... 32 5.1 general ............................................................................................................................... ...................... 32 5.2 address register (ar) ............................................................................................................................. 33 5.3 bank register (bank) ............................................................................................................................. 35 5.4 program status word (psword) .......................................................................................................... 36 5.5 notes on using system register ............................................................................................................ 37 6. general registers (gr) ........................................................................................................... 38 6.1 outline of general registers ................................................................................................................... 38 6.2 address creation of general register with each instruction ................................................................ 39 6.3 notes on using general register ........................................................................................................... 39 7. alu (arithmetic logic unit) block ....................................................................................... 40 7.1 general ............................................................................................................................... ...................... 40 7.2 configuration and function of each block ............................................................................................. 41 7.3 alu processing instructions ................................................................................................................... 41 7.4 notes on using alu ............................................................................................................................... .44
9 m pd17072,17073 8. peripheral control registers ........................................................................................... 45 8.1 outline of peripheral control registers .................................................................................................. 45 8.2 configuration and function of peripheral control registers ................................................................. 46 9. data buffer (dbf) ....................................................................................................................... 54 9.1 general ............................................................................................................................... ...................... 54 9.2 data buffer ............................................................................................................................... ................ 55 9.3 list of peripheral hardware and data buffer functions ........................................................................ 56 9.4 notes on using data buffer ..................................................................................................................... 56 10. general-purpose port ............................................................................................................ 57 10.1 general ............................................................................................................................... ...................... 57 10.2 general-purpose i/o ports (p0b, p0c, p0d) ......................................................................................... 58 10.3 general-purpose input ports (p1a) ........................................................................................................ 62 10.4 general-purpose output ports (p0a, p1b, p1c) ................................................................................... 65 11. interrupt ............................................................................................................................... ........ 66 11.1 general ............................................................................................................................... ...................... 66 11.2 interrupt control block ............................................................................................................................. 67 11.3 interrupt stack register ........................................................................................................................... 70 11.4 stack pointer, address stack register, and program counter ............................................................. 72 11.5 interrupt enable flip-flop (inte) ............................................................................................................ 72 11.6 accepting interrupt ............................................................................................................................... .... 73 11.7 operations after accepting interrupt ....................................................................................................... 77 11.8 exiting from interrupt service routine .................................................................................................... 78 11.9 external (int pin) interrupts ................................................................................................................... 79 11.10 internal interrupt ............................................................................................................................... ........ 81 12. timer ............................................................................................................................... ................. 82 12.1 general ............................................................................................................................... ...................... 82 12.2 basic timer 0 ............................................................................................................................... ............ 82 12.3 basic timer 1 ............................................................................................................................... ............ 91 13. a/d converter ............................................................................................................................. 98 13.1 general ............................................................................................................................... ...................... 98 13.2 setting a/d converter power supply ...................................................................................................... 99 13.3 input selector block ............................................................................................................................... 100 13.4 compare voltage generator block and compare block ..................................................................... 102 13.5 comparison timing chart ...................................................................................................................... 107 13.6 performance of a/d converter .............................................................................................................. 107 13.7 using a/d converter .............................................................................................................................. 1 08 13.8 status at reset ............................................................................................................................... ........ 111 14. serial interface ....................................................................................................................... 112 14.1 general ............................................................................................................................... .................... 112 14.2 clock input/output control block and data input/output control block ............................................. 113 14.3 clock control block ............................................................................................................................... 116 14.4 clock counter ............................................................................................................................... ......... 116
m pd17072,17073 10 14.5 presettable shift register ...................................................................................................................... 117 14.6 wait control block ............................................................................................................................... .. 117 14.7 serial interface operation ..................................................................................................................... 118 14.8 notes on setting and reading data ..................................................................................................... 122 14.9 operational outline of serial interface ................................................................................................. 123 14.10 status on reset ............................................................................................................................... ...... 125 15. pll frequency synthesizer ................................................................................................ 126 15.1 general ............................................................................................................................... .................... 126 15.2 input selector block and programmable divider ................................................................................. 127 15.3 reference frequency generator ........................................................................................................... 133 15.4 phase comparator ( f -det), charge pump, and unlock ff ............................................................... 135 15.5 pll disable status ............................................................................................................................... . 139 15.6 use of pll frequency synthesizer ...................................................................................................... 140 15.7 status on reset ............................................................................................................................... ...... 143 16. intermediate frequency (if) counter ............................................................................. 144 16.1 outline of intermediate frequency (if) counter .................................................................................. 144 16.2 if counter input selector block and gate time control block ........................................................... 145 16.3 start control block and if counter ....................................................................................................... 147 16.4 using if counter ............................................................................................................................... ..... 152 16.5 status at reset ............................................................................................................................... ....... 154 17. beep ............................................................................................................................... ................. 155 17.1 configuration and function of beep .................................................................................................... 155 17.2 output wave form of beep ................................................................................................................. 156 17.3 status at reset ............................................................................................................................... ....... 157 18. lcd controller/driver ......................................................................................................... 158 18.1 outline of lcd controller/driver ........................................................................................................... 158 18.2 lcd drive voltage generation block .................................................................................................... 159 18.3 lcd segment register .......................................................................................................................... 160 18.4 common signal output and segment signal output timing control blocks ..................................... 162 18.5 common signal and segment signal output waves .......................................................................... 163 18.6 using lcd controller/driver .................................................................................................................. 165 18.7 status at reset ............................................................................................................................... ....... 167 19. standby ............................................................................................................................... ......... 168 19.1 general ............................................................................................................................... .................... 168 19.2 halt function ............................................................................................................................... ........... 170 19.3 clock stop function ............................................................................................................................... 178 19.4 device operations in halt and clock stop statuses ............................................................................ 181 19.5 note on processing of each pin in halt and clock stop statuses ..................................................... 182 19.6 device control function by ce pin ...................................................................................................... 185 19.7 low-speed mode function .................................................................................................................... 187
11 m pd17072,17073 20. reset ............................................................................................................................... ............... 188 20.1 configuration of reset block ................................................................................................................. 188 20.2 reset function ............................................................................................................................... ........ 189 20.3 ce reset ............................................................................................................................... ................. 190 20.4 power-on reset ............................................................................................................................... ..... 194 20.5 relations between ce reset and power-on reset ............................................................................ 197 20.6 power failure detection ........................................................................................................................ 199 21. m pd17012 instructions ............................................................................................................ 204 21.1 instruction set outline ........................................................................................................................... 204 21.2 legend ............................................................................................................................... ..................... 205 21.3 instruction list ............................................................................................................................... ......... 206 21.4 assembler (as17k) embedded macroinstructions .............................................................................. 207 22. m pd17073 reserved words .................................................................................................... 208 22.1 data buffer (dbf) ............................................................................................................................... ... 208 22.2 system register (sysreg) .................................................................................................................. 208 22.3 lcd segment register .......................................................................................................................... 209 22.4 port register ............................................................................................................................... ........... 210 22.5 peripheral control register ................................................................................................................... 211 22.6 peripheral hardware register ..................................................................................................................... 22.7 others ............................................................................................................................... ...................... 213 23. electrical characteristics ............................................................................................... 214 24. package drawings ................................................................................................................... 217 25. recommended soldering conditions .............................................................................. 219 appendix a. notes on connecting crystal resonator ................................................ 220 appendix b. development tools .............................................................................................. 221
m pd17072,17073 12 1. pin function 1.1 pin function list pin no. symbol function output format at power-on qfp tqfp reset 1 1 p1c0/so0 port 1c and output of serial interface. cmos push-pull low-level output ? p1c0 ? 1-bit output port ? so0 ? serial data output 2 2 p0a0 4-bit output port (port 0a). cmos push-pull low-level output 3 3 p0a1 4 4 p0a2 5 6 p0a3 6 7 p1b0 4-bit output port (port 1b). cmos push-pull low-level output 7 8 p1b1 8 9 p1b2 9 10 p1b3 10 11 p1a0 port 1a and analog inputs to a/d converter. inputs with pull- 11 13 p1a1 ? p1a3-p1a0 down resistor 12 14 p1a2/ad0 ? 4-bit input port 13 15 p1a3/ad1 ? ad1, ad0 ? analog inputs to a/d converter 14 16 p0c0 2-bit i/o port (port 0c). cmos push-pull input 15 17 p0c1 input/output mode can be set in 1-bit units. 16 18 p0d2/amifc port 0d and if counter inputs. cmos push-pull input 17 19 p0d3/fmifc/ ? p0d3, p0d2 amifc ? 2-bit i/o port ? can be set in input/output mode in 1-bit units. ? fmifc, amifc ? if counter inputs 18 20 gnd ground 21 19 22 eo output from charge pump of pll frequency synthesizer cmos 3-state floating 20 23 vcol input local oscillation frequency of pll. floating 21 24 vcoh 22 25 reg0 output of pll voltage regulator. low-level output connect this pin to gnd via 0.1- m f capacitor. reg0 0.1 f m
13 m pd17072,17073 pin no. symbol function output format at power-on qfp tqfp reset 23 26 v dd positive power supply. 27 supply 1.8 to 3.6 v (t a = C20 to +70 c) to operate all functions. do not apply voltage higher than that of v dd pin to any pin other than v dd . 24 28 x out pins for connecting crystal resonator for system cmos push-pull 25 29 x in clock oscillation. 26 30 reg1 output of voltage regulator for oscillation circuit. connect this pin to gnd via 0.1- m f capacitor. 27 31 reg lcd 0 ? reg lcd 1, reg lcd 0 28 32 cap lcd 0 lcd drive power pins. 29 33 cap lcd 1 ? cap lcd 1, cap lcd 0 30 34 reg lcd 1 connect capacitors for doubler circuit to generate lcd drive voltage, across these pins. to configure doubler circuit, connect capacitors as shown below. caution the value of the lcd drive voltage differs if the values of c1, c2, and c3 are changed because of the configuration of the doubler circuit. reg1 0.1 f m reg lcd 1 cap lcd 1 cap lcd 0 reg lcd 0 c3 c1 c2 c1 = c2 = 0.1 f c3 = 0.01 f m m
m pd17072,17073 14 pin no. symbol function output format at power-on qfp tqfp reset 31 35 com0 common signal outputs of lcd controller/driver. cmos ternary low-level output 32 36 com1 output 33 37 com2 34 39 com3 35 40 lcd0 segment signal outputs of lcd controller/driver. cmos push-pull low-level output | | | 49 56 lcd14 50 57 ce device operation select and reset signal input. input 51 58 int external interrupt request signal input. input interrupt request is issued at rising or falling edge of signal input to this pin. 52 60 beep beep signal output pin. cmos push-pull low-level output beep output of 1.5 khz or 3 khz can be selected. 53 61 p0b0 port 0b and serial interface i/o. cmos push-pull input 54 62 p0b1 ? p0b3-p0b0 55 63 p0b2/sck ? 4-bit i/o port 56 64 p0b3/si/so1 ? can be set in input or output mode in 1-bit units. ? sck ? serial clock i/o ? so1 ? serial data output ? si ? serial data input 5 nc no connection 12 38 45 54 59
15 m pd17072,17073 1.2 equivalent circuits of pins (1) p0b (p0b3/si/so1, p0b2/sck, p0b1, p0b0) p0c (p0c1, p0c0) (i/o) p0d (p0d3/fmifc/amifc, p0d2/amifc) (3) p1a (p1a3/ad1, p1a2/ad0, p1a1, p1a0) (input) (2) p0a (p0a3, p0a2, p0a1, p0a0) p1b (p1b3, p1b2, p1b1, p1b0) p1c (p1c0/so0) (output) lcd14-lcd0 beep eo v dd v dd v dd v dd high on resistance
m pd17072,17073 16 (4) ce (schmitt trigger input) (5) int (schmitt trigger input) (6) x out (output), x in (input) v dd ce flag v dd v dd v dd high on resistance high on resistance x out x in
17 m pd17072,17073 (7) com3 through com0 (output) (9) vcol (input) (8) vcoh (input) v lcd1 v lcd0 v dd high on resistance v dd high on resistance pll disable signal pll disable signal v dd v dd high on resistance
m pd17072,17073 18 1.3 processing of unused pins it is recommended that the unused pins be connected as follows: table 1-1. processing of unused pins pin name i/o mode recommended processing of unused pins port pin p0a0-p0a3 cmos push-pull output open p0b0, p0b1 i/o note 1 set by software to output low level and open p0b2/sck p0b3/si/so1 p0c0, p0c1 p0d2/amifc p0d3/fmifc/amifc p1a0, p1a1 input connect each of these pins to v dd or gnd via resistor note 2 . p1a2/ad0 p1a3/ad1 p1b0-p1b3 cmos push-pull output open p1c0/so0 pins other beep cmos push-pull output open than port ce input connect to v dd via resistor note 2 . pins com0-com3 output open eo output int input connect to gnd via resistor note 2 . lcd0-lcd14 cmos push-pull output open vcoh, vcol input connect each of these pins to gnd via resistor note 2 . notes 1. the i/o ports are set in the input mode on power application, on clock stop, and on ce reset. 2. when pulling up (connecting to v dd via resistor) or pulling down (connecting to gnd via resistor) a pin externally with high resistance, the pin almost goes into a high-impedance state, and consequently, the current consumption (through current) of the port increases. generally, the pull-up or pull-down resistance is several 10 k w , though it varies depending on the application circuit.
19 m pd17072,17073 1.4 notes on using ce pin the ce pin has a function to set a test mode in which the internal operations of the m pd17073 are tested (dedicated to ic test), in addition to the functions listed in 1.1 pin function list. when a voltage higher than v dd is applied to the ce pin, the test mode is set. this means that if noise exceeding v dd is applied to the ce pin even during normal operation, the test mode is set, affecting the normal operation. if the wiring of the ce pin is too long, the above problem occurs because wiring noise is superimposed on the ce pin. therefore, wire the ce pin with as short a wiring length as possible to suppress noise. if noise cannot be avoided, use external components as shown below to suppress noise. ? connect a diode with low v f between ce and v dd ? connect a capacitor between ce and v dd v dd ce v dd diode with low v f v dd ce v dd
m pd17072,17073 20 2. program memory (rom) 2.1 general figure 2-1 shows the configuration of the program memory. as shown in this figure, the program memory consists of a program memory and a program counter. the addresses of the program memory are specified by the program counter. the program memory has the following two major functions: (1) stores program (2) stores constant data figure 2-1. outline of program memory program counter program memory specifies address instruction constant data
21 m pd17072,17073 2.2 program memory figure 2-2 shows the configuration of the program memory. as shown in this figure, the program memory is configured as follows: m pd17072: 3072 16 bits (0000h-0bffh) m pd17073: 4096 16 bits (0000h-0fffh) therefore, the addresses of the program memory range from 0000h to 0fffh. all the instructions are one-word instructions each of which is 16 bits long. consequently, one instruction can be stored in one address of the program memory. as constant data, the contents of the program memory are read to the data buffer by using a table reference instruction. figure 2-2. configuration of program memory caution with the m pd17072, the range of addresses that can be called by each instruction is 0000h to 0bffh. the area from addresses 0c00h through 0fffh is an undefined area. 2.3 program counter figure 2-3 shows the configuration of the program counter. the program counter specifies an address of the program memory. as shown in this figure, the program counter is a 12-bit binary counter. the most significant bit b 11 indicates a page. figure 2-3. configuration of program counter pc 11 pc 10 pc 9 pc 8 pc 7 pc 6 page pc pc 5 pc 4 pc 3 pc 2 pc 1 pc 0 reset start address serial interface interrupt vector basic timer 1 interrupt vector int pin interrupt vector (with pd17072) (with pd17073) 16 bits page 0 call addr instruction subroutine entry address page 1 br addr instruction branch address br @ar instruction branch address call @ar instruction subroutine entry address movt dbf @ar instruction table reference address h h h h h h h 0 1 2 3 f f f 0 0 0 0 f f f 0 0 0 0 7 b f 0 0 0 0 0 0 0 m m
m pd17072,17073 22 2.4 execution flow of program memory execution of the program is controlled by the program counter which specifies an address of the program memory. figure 2-4 shows the values to be set to the program counter when each instruction is executed. table 2-1 shows the vector addresses that are to be set to the program counter when each interrupt occurs. figure 2-4. specification by program counter on execution of each instruction table 2-1. interrupt vector address priority internal/external interrupt source vector address 1 external int pin 0003h 2 external basic timer 1 0002h 3 external serial interface 0001h 2.5 notes on using program memory (1) m pd17072 the program memory addresses of the m pd17072 are 0000h through 0bffh. however, because the addresses that can be specified by the program counter (pc) are 0000h through 0fffh, keep the following points in mind when specifying a program memory address: ? be sure to write a branch instruction to address 0bffh, when writing an instruction to this address. ? do not write an instruction to addresses 0c00h through 0fffh. ? do not branch to addresses 0c00h through 0fffh. (2) with m pd17073 the program memory addresses of the m pd17073 are 0000h through 0fffh. keep the following point in mind: ? be sure to write a branch instruction to address 0fffh, when writing an instruction to this address. program counter instruction br addr call addr br @ar call @ar movt dbf, @ar ret retsk reti power-on reset, ce reset page 0 page 1 0 1 instruction operand (addr) b 11 b 10 b 9 b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 contents of program counter (pc) vector address of each interrupt 0000 00000000 instruction operand (addr) contents of address register contents of address stack register (asr) specified by stack pointer (sp) (return address) when interrupt is accepted 0
23 m pd17072,17073 3. address stack (ask) 3.1 general figure 3-1 outlines the address stack. the address stack consists of a stack pointer and an address stack register. the address of the address stack register is specified by the stack pointer. the address stack saves return addresses when a subroutine call instruction has been executed and when an interrupt has been accepted. the address stack is also used when a table reference instruction is executed. figure 3-1. outline of address stack 3.2 address stack register (asr) figure 3-2 shows the configuration of the address stack register. the address stack register consists of three 12-bit registers asr0-asr2. actually, however, no register is assigned to asr2, and the address stack register therefore consists of two 12-bit registers (asr0 and asr1). the address stack saves return addresses when a subroutine call instruction has been executed, when an interrupt has been accepted, and when a table reference instruction is executed. figure 3-2. configuration of address stack register stack pointer address stack register return address specifies address address stack register (asr) stack pointer (sp) bit bit address 0h 1h 2h asr0 asr1 asr2 (undefined) cannot be used b 3 b 2 b 1 b 0 0 0 sp1 sp0 b 11 b 10 b 9 b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0
m pd17072,17073 24 3.3 stack pointer (sp) figure 3-3 shows the configuration and functions of the stack pointer. the stack pointer is a 4-bit binary counter. the stack pointer specifies the addresses of the address stack registers. the value of the stack pointer can be directly read or written by using a register manipulation instruction. figure 3-3. configuration and functions of stack pointer name flag symbol address read/ write stack pointer sp 01h r/w s p 1 s p 0 0 0 specifies address of address stack register (asr) b 3 b 2 b 1 b 0 00 01 10 0010 10 10 power-on clock stop ce address 0 (asr0) address 1 (asr1) address 2 (asr2) fixed to "0" at reset
25 m pd17072,17073 3.4 operations of address stack 3.4.1 subroutine call (call addr or call @ar) and return (ret or retsk) instructions when a subroutine call instruction is executed, the value of the stack pointer is decremented by one and the return address is stored to the address stack register specified by the stack pointer. when a return instruction is executed, the contents of the address stack specified by the stack pointer (return address) is restored to the program counter, and the value of the stack pointer is incremented by one. 3.4.2 table reference instruction (movt dbf, @ar) when the table reference instruction is executed, the value of the stack pointer is decremented by one and the return address is stored to the address stack register specified by the stack pointer. next, the contents of the program memory addressed by the address register are read to the data buffer, and the contents of the address stack register specified by the stack pointer (return address) are restored to the program counter. the value of the stack pointer is then incremented by one. 3.4.3 on acceptance of interrupt and execution of return instruction (reti instruction) when an interrupt is accepted, the value of the stack pointer is decremented by one, and the return address is stored to the address stack register specified by the stack address. when the return instruction is executed, the contents of the address stack register specified by the stack pointer (return address) are restored to the program counter and the value of the stack pointer is incremented by one. 3.4.4 address stack manipulation instructions (push ar and pop ar) when the push instruction is executed, the value of the stack pointer is decremented by one, and the contents of the address register are transferred to the address stack register specified by the stack pointer. when the pop instruction is executed, the contents of the address stack register specified by the stack pointer are transferred to the address register, and the value of the stack pointer is incremented by one. 3.5 notes on using address stack the nesting level of the address stack is two, and the value of the address stack register asr2 is undefined when the value of the stack pointer is 2h. consequently, if a subroutine is called or an interrupt is used exceeding 2 levels without manipulating the stack, program execution returns to an undefined address.
m pd17072,17073 26 4. data memory (ram) 4.1 general figure 4-1 outlines the data memory. as shown in this figure, the data memory consists of a general-purpose data memory, system register, data buffer, general register, lcd segment register, port register, and peripheral control register. the data memory stores data, transfers data with peripheral hardware, sets conditions for the peripheral hardware, display data, transfers data with ports, and controls the cpu. figure 4-1. outline of data memory column address 0123456789abcdef general register data buffer data memory bank0 port register bank1 lcd segment register peripheral control register system register port register port data transfer data transfer condition setting lcd peripheral hardware data transfer peripheral hardware 0 1 2 3 4 5 6 7 row address
27 m pd17072,17073 4.2 configuration and function of data memory figure 4-2 shows the configuration of the data memory. as shown in this figure, the data memory is divided into three banks, and each bank consists of 128 nibbles with 7h row addresses and 0fh column addresses. in terms of function, the data memory can be divided into six blocks each of which is described in the following paragraphs 4.2.1 through 4.2.8. the contents of the data memory can be operated, compared, judged, and transferred in 4-bit units by data memory manipulation instructions. table 4-1 lists the data memory manipulation instructions. 4.2.1 system registers (sysreg) the system registers are allocated to addresses 74h through 7fh. these registers are allocated independently of the bank and directly control the cpu. the same system registers exist at addresses 74h through 7fh of each bank. with the m pd17073, only ar (address register: addresses 75h through 77h), bank (bank register: address 79h), and psword (program status word: addresses 7eh and 7fh) can be manipulated. for details, refer to 5. system register (sysreg) . 4.2.2 data buffer (dbf) the data buffer is allocated to addresses 0ch through 0fh of bank0. the data buffer reads the constant data in the program memory (table reference), and transfers data with peripheral hardware. for details, refer to 9. data buffer (dbf) . 4.2.3 general registers with the m pd17073, the general registers are fixed at row address 0 of bank0, i.e., addresses 00h through 0fh, and cannot be moved. operations and data transfer between the general registers and data memory can be executed with a single instruction. the general registers can be controlled by data memory manipulation instructions, like the other data memory areas. for details, refer to 6. general register (gr) . 4.2.4 lcd segment registers the lcd segment registers are allocated to addresses 41h through 4fh of bank1 of the data memory, and are used to set the display data of the lcd controller/driver. for details, refer to 18. lcd controller/driver . 4.2.5 port registers the port registers are allocated to addresses 70h through 73h of bank0 and addresses 70h through 73h of bank1, and are used to set the output data of each general-purpose port and read the data of the input ports. for details, refer to 10. general-purpose port . 4.2.6 peripheral control registers the peripheral control registers are allocated to addresses 50h through 6fh of bank1 and are used to set the conditions of the peripheral hardware (such as pll, serial interface, a/d converter, if counter, and timer). for details, refer to 8. peripheral control register .
m pd17072,17073 28 4.2.7 general-purpose data memory the general-purpose data memory is allocated to the area of the data memory excluding the system register, lcd segment register, port register, and peripheral control register. with the m pd17073, a total of 176 nibbles (176 4 bits), 112 nibbles of bank0 and 64 nibbles of bank1, can be used as the general-purpose data memory. 4.2.8 data memory areas not provided for these data memory areas, refer to 4.4.2 notes on data memory areas not provided, 8.2 configuration and function of peripheral control registers , and table 10-1 relation between each port (pin) and port register .
29 m pd17072,17073 figure 4-2. configuration of data memory column address 0123456789abcdef data memory bank0 0 1 2 3 4 5 6 7 bank1 system register column address 0 1 2 3 4 5 6 7 bank0 port register system register (sysreg) data buffer example address 2bh of bank0 b 3 b 2 b 1 b 0 0 1 2 3 4 5 6 7 port register system register (sysreg) bank1 lcd segment register peripheral control register same system register exists. general register 0123456789abcdef 0123456789abcdef row address row address row address caution address 40h of bank1, bit 3 of address 50h, and address 73h are test mode areas. do not write 1 to these areas.
m pd17072,17073 30 table 4-1. data memory manipulation instructions 4.3 addressing data memory figure 4-3 shows how to address the data memory. an address of the data memory is specified by using a bank, row address, and column address. the row address and column address are directly specified by a data memory manipulation instruction, but the bank is specified by the contents of the bank register. for details of the bank register, refer to 5. system register (sysreg) . figure 4-3. addressing data memory function instruction add add addc sub operation subtract subc and logical or xor ske skge compare sklt skne mov transfer ld st skt judge skf b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 2 b 1 b 0 data memory address m bank register instruction operand bank row address column address
31 m pd17072,17073 4.4 notes on using data memory 4.4.1 on power-on reset on power-on reset, the contents of the general-purpose data memory are undefined. initialize the memory if necessary. 4.4.2 notes on data memory not provided if a data memory manipulation instruction is executed to manipulate an address where no data memory is assigned, the following operations are performed: (1) device operation when a read instruction is executed, 0 is read. nothing is changed even when a write instruction is executed. address 40h of bank1, bit 3 of address 50h, and address 73h are test mode areas. do not write 1 to these areas. (2) assembler operation the program is assembled normally. no error occurs. (3) in-circuit emulator operation 0 is read when a read instruction is executed. nothing is changed when a write instruction is executed. no error occurs.
m pd17072,17073 32 5. system register (sysreg) 5.1 general figure 5-1 shows the location of the system register on the data memory and outline. as shown, the system register is assigned to addresses 74h-7fh of the data memory, regardless of bank. in other words, the same system register is assigned to addresses 74h-7fh of any bank. since the system register is located on the data memory, it can be manipulated by all the data memory manipulation instructions. with the m pd17073, only the address register (ar: 74h through 77h), bank register (bank: 79h), and program status word (psword: 7eh, 7fh) of addresses 74h through 7fh can be manipulated. figure 5-1. location of system register on data memory and outline 0 0 123456789abcdef 1 2 3 4 5 6 7 column address data memory bank0 bank1 system register address 74h 75h 76h 77h 78h 79h name outline address register (ar) controls program memory address fixed to 0 bank register (bank) specifies data memory bank address 7ah 7bh 7ch 7dh 7eh 7fh name fixed to 0 program status word (psword) controls operation outline row address
33 m pd17072,17073 5.2 address register (ar) 5.2.1 configuration of address register figure 5-2 shows the configuration of the address register. as shown in this figure, the address register consists of 16 bits of the system register: 74h through 77h (ar3 through ar0). however, the higher 4 bits are always fixed to 0, and therefore, the address register actually functions as a 12-bit register. figure 5-2. address register configuration address 74h 75h 76h 77h name address register (ar) symbol bit data b 3 ar2 ar1 ar0 000 0 0 0 power-on clock stop ce 0 0 0 0 0 0 0 0 0 at reset m s b l s b ar3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 0 remark power-on : on power-on reset clock stop : on execution of clock stop instruction ce : on ce reset
m pd17072,17073 34 5.2.2 functions of address register the address register specifies a program memory address when the table reference instruction (movt dbf, @ar), stack manipulation instruction (push ar or pop ar), indirect branch instruction (br @ar), and indirect subroutine call instruction (call @ar) has been executed. a dedicated instruction (inc ar) that can increment the value of the address register by one is available. the following paragraphs (1) through (5) describe the operations of the address register when each of these instructions has been executed. (1) table reference instruction (movt dbf, @ar) when the movt dbf, @ar instruction is executed, the constant data (16 bits) of the program memory address specified by the contents of the address register are read to the data buffer. the addresses of the constant data which can be specified by the address register are 0000h-0fffh. (2) stack manipulation instruction (push ar, pop ar) by executing the push ar instruction, the stack pointer is decremented by one and the contents of the address register (ar) are stored to the address stack register specified by the stack pointer. when the pop ar instruction is executed, the contents of the address stack register specified by the stack pointer are transferred to the address register, and the stack pointer is incremented by one. (3) indirect branch instruction (br @ar) when the br @ar instruction is executed, the program execution branches to a program memory address specified by the contents of the address register. the branch addresses that can be specified by the address register are 0000h-0fffh. (4) indirect subroutine call instruction (call @ar) when the call @ar instruction is executed, the subroutine at the program memory address specified by the contents of the address register can be called. the first addresses of the subroutine that can be specified by the address register are 0000h-0fffh. (5) address register increment instruction (inc ar) this instruction increments the contents of the address register by one each time it is executed. since the address register is configured of 12 bits, its contents become 0000h when the inc ar instruction is executed with the contents of the address register being 0fffh. 5.2.3 address register and data buffer the address register can transfer data through the data buffer as a part of the peripheral hardware. for details, refer to 9. data buffer (dbf) .
35 m pd17072,17073 5.3 bank register (bank) 5.3.1 configuration of bank register figure 5-3 shows the configuration of the bank register. as shown in this figure, the bank register consists of 4 bits of address 79h (bank) of the system register. note, however, that the higher 3 bits are always fixed to 0; therefore, this register actually serves as a 1-bit register. figure 5-3. bank register configuration address 79h name symbol bit data bank register (bank) bank 0 at reset power-on clock stop ce 0 b 3 b 2 b 1 b 0 0 0 0 0 5.3.2 function of bank register the bank register selects a bank of the data memory. table 5-1 shows the value of the bank register and how a bank of the data memory is specified. since the bank register exists on the system register, its contents can be rewritten regardless of the currently specified bank. in other words, the current bank status has nothing to do with manipulation of the bank register. table 5-1. specifying bank of data memory bank of data memory bank0 bank1 bank register (bank) b 3 b 2 b 1 b 0 0000 0001 CCCCCC CCCCCC CCCCCC
m pd17072,17073 36 5.4 program status word (psword) 5.4.1 configuration of program status word figure 5-4 shows the configuration of the program status word. as shown in this figure, the program status word consists of a total of 5 bits: the least significant bit of address 7eh (rpl) and 4 bits of 7fh (psw) of the system register. however, bit 0 of 7fh is always fixed to 0. each of the 5 bits in the program status word has its own function as a bcd flag (bcd), compare flag (cmp), carry flag (cy), zero flag (z), respectively. figure 5-4. program status word configuration address name symbol bit data 7eh 7fh program status word (psword) rpl psw at reset power-on clock stop ce 0 0 0 0 0 0 b c d z 0 b 0 b 2 b 2 b 0 b 0 b 2 b 2 b 0 (rp) c m p c y
37 m pd17072,17073 5.4.2 functions of program status word the program status word sets conditions, under which the alu (arithmetic logic unit) performs arithmetic or transfer operations, and indicates the results of the operations. table 5-2 outlines the function of each flag of the program status word. for details, refer to 7. alu (arithmetic logic unit) block . table 5-2. functional outline of each flag of program status word flag name function zero flag (z) carry flag (cy) compare flag (cmp) bcd flag (bcd) 5.4.3 notes on using program status word when an arithmetic operation (addition or subtraction) instruction is executed to the program status word, the result of the arithmetic operation is stored in the program status word. even if an operation that generates a carry has been executed, for example, if the result of the operation is 0000b, 0000b is stored in psw. 5.5 notes on using system register the data in the system register which are fixed to 0 are not influenced even when a write instruction is executed. when these data are read, 0 is always read. indicates that the result of arithmetic operation is 0. con- dition under which this flag is set differs depending on contents of compare flag. indicates occurrence of carry or borrow as a result of executing addition or subtraction instruction. reset (0) when carry or borrow does not occur. set (1) when carry or borrow occurs. also used as shift bit of "rorc r" instruction. stores or does not store result of arithmetic operation in data memory or general register. 0: stores result 1: does not store result executes arithmetic operation in decimal. 0: executes binary operation 1: executes decimal operation (rp) program status word (psword) rpl psw b c d c m p c y z0 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0
m pd17072,17073 38 6. general registers (gr) 6.1 outline of general registers with the m pd17073, the general registers are fixed at row address 0 of bank0 on the data memory, and consist of 16 nibbles (16 4 bits) of 00h through 0fh. the 16 nibbles of the row address 0 specified as the general registers can perform operations and data transfer with the data memory with a single instruction. in other words, operations and data transfer between data memory areas can be executed with a single instruction. the general registers can be controlled by data memory manipulation instructions, like the other data memory areas. figure 6-1. outline of general registers column address 0123456789abcdef system registers 0 1 2 3 4 5 6 7 general registers transfer, operation data memory bank0 bank1 row address
39 m pd17072,17073 6.2 address creation of general register with each instruction the following paragraphs 6.2.1 and 6.2.2 describe how the address of the general register is created when each instruction is executed. for details of the operation of each instruction, refer to 7. alu (arithmetic logic unit) block . 6.2.1 addition (add r, m, addc r, m), subtraction (sub r, m, subc r, m), logical operation (and r, m, or r, m, xor r, m), direct transfer (ld r, m, st m, r), rotate processing (rorc r) instructions table 6-1 shows the address of general register r specified by an instruction operand r. the operand r specifies only the column address. table 6-1. address creation of general register 6.3 notes on using general register there is no instruction available that performs an operation between the general register and immediate data. to perform an operation between the data memory specified as the general register and immediate data, the data memory must be treated as data memory instead of as the general register. bank row address column address general register address r fixed to 0 r b 3 b 2 b 1 b 0 b 2 b 1 b 0 b 3 b 2 b 1 b 0 fixed to 1 6.2.2 indirect transfer (mov @r, m, mov m, @r) instructions table 6-2 shows the address of the general register r specified by instruction operand r, and the indirect transfer address specified by @r. table 6-2. address creation of general register bank row address column address general register address r fixed to 0 r b 3 b 2 b 1 b 0 b 2 b 1 b 0 b 3 b 2 b 1 b 0 indirect transfer address @r contents of r fixed to 0 fixed to 0 fixed to 0
m pd17072,17073 40 7. alu (arithmetic logic unit) block 7.1 general figure 7-1 shows the configuration of the alu block. as shown in the figure, the alu block consists of an alu, temporary registers a and b, program status word, decimal adjuster circuit, and data memory address control circuit. the alu performs arithmetic operation, judgment, comparison, rotation, and transfer of 4-bit data on the data memory. figure 7-1. outline of alu block data bus address control temporary register a temporary register b data memory program status word carry/borrow/zero detection/decimal/storage alu arithmetic operation logical operation bit judgment comparison rotation transfer decimal adjuster circuit
41 m pd17072,17073 7.2 configuration and function of each block 7.2.1 functions of alu the alu performs arithmetic operation, logical operation, bit judgment, comparison, rotation, and transfer of 4- bit data as the instruction specified by the program. 7.2.2 temporary registers a and b temporary registers a and b temporarily stores 4-bit data. these registers are automatically used when an instruction is executed and cannot be controlled by program. 7.2.3 program status word the program status word controls the operations of the alu and stores the status of the alu. for details, refer to 5.4 program status word (psword) . 7.2.4 decimal adjuster circuit when the bcd flag of the program status word is set to 1 during an arithmetic operation, the result of the operation is converted into decimal numbers by the decimal adjuster circuit. 7.2.5 address control circuit the address control circuit specifies an address of the data memory. 7.3 alu processing instructions table 7-1 shows the operations of the alu when each instruction is executed. table 7-2 shows the decimal adjusted data when a decimal operation is performed.
m pd17072,17073 42 table 7-1. alu processing instruction list stores result of binary addition does not store result of binary operation stores result of decimal operation does not store result of decimal operation no change no change no change no change no change 0 1 0 1 any (retained) any (reset) any (retained) any (retained) any (retained) 0 0 1 1 any (retained) any (retained) any (retained) any (retained) any (retained) add addc sub subc or and xor skt skf ske skne skge sklt ld st mov rorc instruction r, m m, #n4 r, m m, #n4 r, m m, #n4 r, m m, #n4 r, m m, #n4 r, m m, #n4 r, m m, #n4 m, #n m, #n m, #n4 m, #n4 m, #n4 m, #n4 r, m m, r m, #n4 @r, m m, @r r value of cmp flag value of bcd flag operation difference of operation due to program status word (psword) C CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCC comparison transfer rotation judgment logical operation subtraction addition alu function set if result of operation is 0000b; otherwise, reset retains status if result of operation is 0000b; otherwise, reset set if result of operation is 0000b; otherwise, reset retains status if result of operation is 0000b; otherwise, reset retains previous status retains previous status retains previous status retains previous status retains previous status operation of z flag set if carry or borrow occurs; otherwise, reset retains previous status retains previous status retains previous status retains previous status value of b 0 of general register operation of cy flag
43 m pd17072,17073 table 7-2. decimal adjusted data hexadecimal addition decimal addition cy cy result of operation result of operation 0 0 0000b 0 0000b 1 0 0001b 0 0001b 2 0 0010b 0 0010b 3 0 0011b 0 0011b 4 0 0100b 0 0100b 5 0 0101b 0 0101b 6 0 0110b 0 0110b 7 0 0111b 0 0111b 8 0 1000b 0 1000b 9 0 1001b 0 1001b 10 0 1010b 1 0000b 11 0 1011b 1 0001b 12 0 1100b 1 0010b 13 0 1101b 1 0011b 14 0 1110b 1 0100b 15 0 1111b 1 0101b 16 1 0000b 1 0110b 17 1 0001b 1 0111b 18 1 0010b 1 1000b 19 1 0011b 1 1001b 20 1 0100b 1 1110b 21 1 0101b 1 1111b 22 1 0110b 1 1100b 23 1 0111b 1 1101b 24 1 1000b 1 1110b 25 1 1001b 1 1111b 26 1 1010b 1 1100b 27 1 1011b 1 1101b 28 1 1100b 1 1010b 29 1 1101b 1 1011b 30 1 1110b 1 1100b 31 1 1111b 1 1101b result of operation decimal subtraction cy result of operation result of operation 0 0 0000b 0 0000b 1 0 0001b 0 0001b 2 0 0010b 0 0010b 3 0 0011b 0 0011b 4 0 0100b 0 0100b 5 0 0101b 0 0101b 6 0 0110b 0 0110b 7 0 0111b 0 0111b 8 0 1000b 0 1000b 9 0 1001b 0 1001b 10 0 1010b 1 1100b 11 0 1011b 1 1101b 12 0 1100b 1 1110b 13 0 1101b 1 1111b 14 0 1110b 1 1100b 15 0 1111b 1 1101b C16 1 0000b 1 1110b C15 1 0001b 1 1111b C14 1 0010b 1 1100b C13 1 0011b 1 1101b C12 1 0100b 1 1110b C11 1 0101b 1 1111b C10 1 0110b 1 0000b C 9 1 0111b 1 0001b C 8 1 1000b 1 0010b C 7 1 1001b 1 0011b C 6 1 1010b 1 0100b C 5 1 1011b 1 0101b C 4 1 1100b 1 0110b C 3 1 1101b 1 0111b C 2 1 1110b 1 1000b C 1 1 1111b 1 1001b result of operation hexadecimal subtraction cy remark the shaded part indicates that decimal adjustment is not made correctly.
m pd17072,17073 44 7.4 notes on using alu 7.4.1 notes on executing operation to program status word when an arithmetic operation is performed to the program status word, the result of the operation is stored in the program status word. the cy and z flags of the program status word are usually set or reset according to the result of an arithmetic operation executed. however, if the program status word itself is used for an operation, the result of the operation is stored in the program status word, making it impossible to judge whether a carry or borrow occurs, or the result of the operation is zero. however, if the cmp flag is set, the result of the operation is not stored in the program status word; consequently, the cy and z flags are set (1) or cleared (0) normally. 7.4.2 notes on using decimal operation a decimal operation can be executed only if the result of the operation falls within the following range: (1) result of addition must be 0 to 19 in decimal. (2) result of subtraction must be 0 to 9 or C10 to C1 in decimal. if a decimal operation is executed exceeding this range, the cy flag is set, and the result is 1010b (0ah) or higher.
45 m pd17072,17073 8. peripheral control registers 8.1 outline of peripheral control registers figure 8-1 outlines the peripheral control registers. thirty-two 4-bit peripheral registers are available that control the peripheral hardware such as the pll frequency synthesizer, serial interface, and intermediate frequency counter (if). because the peripheral control registers are located on the data memory, they can be manipulated by all the data memory manipulation instructions. figure 8-1. outline of peripheral control registers column address 0123456789abcdef 0 1 2 3 4 5 6 7 system registers bank0 bcdef bank1 0 1 2 3 4 5 6 7 data memory peripheral hardware peripheral control register row address
m pd17072,17073 46 8.2 configuration and function of peripheral control registers figure 8-2 shows the configuration of the peripheral control registers. table 8-1 lists the peripheral hardware control functions of the peripheral control registers. as shown in figure 8-2, the peripheral control registers consist of a total of 32 nibbles (32 4 bits) of addresses 50h through 6fh of bank1. each peripheral control register has an attribute of 1 nibble, and is classified into four types: read/write (r/w), read- only (r), write-only (w), and read-and-reset (r&reset) registers. nothing is changed even if data is written to the read only (r and r&reset) registers. if a write-only (w) register is read, the value is undefined. of the 4-bit data of 1 nibble, the bits fixed to 0 are always 0 when read, and also 0 when data is written to these bits. caution bit 3 of address 50h of bank1 (bit 3 of the lcd driver display start register) is allocated to a test mode area. therefore, do not write 1 to this bit.
47 m pd17072,17073 [memo]
m pd17072,17073 48 figure 8-2. configuration of peripheral control registers (1/2) (bank1) column address row address item name lcd driver display start register basic timer 0 carry register ce pin status detection register port 1a pull-down resistor select register stack pointer system clock select register interrupt edge select register interrupt enable register 01234567 symbol read/ write a d c o n 0 0 note l c d e n0 00 b t m 0 c y 000 c e p 1 a p l d 1 p 1 a p l d 3 p 1 a p l d 2 p 1 a p l d 0 s p 1 00 s p 0 0 00 s y s c k b t m 1 c k 0 i n t i e g i p b t m 1 0 i p s i o i p r/w r&reset r r/w r/w r/w r/w r/w name serial i/o mode select register serial i/o clock select register if counter mode select register if counter gate status detection register pll mode select register pll reference frequency select register pll data register if counter control register 5 6 symbol s i o h i z s i o s e l 0 s i o t s s i o c k 1 00 s i o c k 0 i f c m d 1 i f c m d 0 i f c c k 1 i f c c k 0 0 00 i f c g i f c s t r t 00 i f c r e s p l l m d 1 00 p l l m d 0 p l l r f c k 1 0 p l l r f c k 2 p l l r f c k 0 p l l r 1 5 p l l r 1 7 p l l r 1 6 p l l r 1 4 read/ write r/w r/w r/w r w r/w r/w r/w note this is a test mode area. do not write 1 to this area.
49 m pd17072,17073 figure 8-2. configuration of peripheral control registers (2/2) int pin interrupt request register basic timer 1 interrupt request register serial interface interrupt request register beep clock select register a/d converter channel select register a/d converter reference voltage setting register a/d converter compare start register a/d converter compare result detection register 89abcdef 0 0 0 i r q 0 00 i r q b t m 1 000 i r q s i o b e e p 0 c k 1 00 b e e p 0 c k 0 a d c c h 1 00 a d c c h 0 a d c r f s e l 1 a d c r f s e l 3 a d c r f s e l 2 a d c r f s e l 0 0 00 a d c s t r t 0 00 a d c c m p r/w r/w r/w r/w r/w r/w r/w r pll data register pll unlock ff register port 0b bit i/o select register port 0c bit i/o select register pll data set register p l l r 1 1 p l l r 1 2 p l l r 1 3 p l l r 1 0 p l l r 7 p l l r 9 p l l r 8 p l l r 6 p l l r 5 p l l r 4 p l l r 3 p l l r 20 p l l r 10 0 0 00 p l l p u t 0 00 p l l u l p 0 b b i o 1 p 0 b b i o 3 p 0 b b i o 2 p 0 b b i o 0 p 0 c b i o 1 p 0 d b i o 3 p 0 d b i o 2 p 0 c b i o 0 r/w w r&reset r/w r/w
m pd17072,17073 50 table 8-1. peripheral hardware control functions of peripheral control registers (1/4) peripheral control register peripheral hardware control function at reset hardware name address read/ b 3 functional outline set value power- clock ce write b 2 symbol on stop b 1 b 0 01 stack stack pointer (bank1) r/w 0 fixed to 0 222 (sp) 54h 0 sp1 stack pointer sp0 timer basic timer 0 (bank1) r& 0 fixed to 0 011 carry register 51h reset 0 0 btm0cy detects status of carry ff reset set interrupt interrupt edge (bank1) r/w 0 fixed to 0 000 select register 56h int detects status of int pin low level high level btm1ck sets set time interval of irqbtm1 flag 32 ms (31.25 hz) 8 ms (125 hz) ieg sets interrupt issuing edge of int pin rising edge falling edge interrupt enable (bank1) r/w 0 fixed to 0 000 register 57h ipsio serial interface disables interrupt enables interrupt ipbtm1 basic timer 1 enables interrupt ip int pin int pin interrupt (bank1) r/w 0 fixed to 0 000 request register 58h 0 0 irq detects interrupt request of int pin not requested requested basic timer 1 (bank1) r/w 0 fixed to 0 000 interrupt request 59h 0 register 0 irqbtm1 detects interrupt request of basic timer 1 not requested requested serial interface (bank1) r/w 0 fixed to 0 000 interrupt request 5ah 0 register 0 irqsio detects interrupt of serial interface not requested requested pin ce pin status (bank1) r 0 fixed to 0 CCC detection register 52h 0 0 ce detects status of ce pin low level high level port 1a pull-down (bank1) r/w p1apld3 p1a3 resistor on resistor off 0 r r select register 53h p1apld2 p1a2 selects pull-down p1apld1 p1a1 resistor of these pins p1apld0 p1a0 remark C: determined by status of pin, r: previous status is retained. CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCC C C CCCCCCC- CCCCCCCC- CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCC- CCCCCCCC- CCCCCCCC- CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCC- CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCC- CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCC- CCCCCCCC- CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC
51 m pd17072,17073 table 8-1. peripheral hardware control functions of peripheral control registers (2/4) peripheral control register peripheral hardware control function at reset hardware name address read/ b 3 functional outline set value power- clock ce write b 2 symbol on stop b 1 b 0 01 pll pll mode select (bank1) r/w 0 fixed to 0 00 r frequency register 65h 0 synthesizer pllmd1 sets division mode of pll pllmd0 pll reference (bank1) r/w 0 fixed to 0 00r frequency select 66h pllrfck2 sets reference frequency of pll register pllrfck1 pllrfck0 pll data register (bank1) r/w pllr17 sets division ratio of pll u r r 67h pllr16 pllr15 pllr14 (bank1) pllr13 68h pllr12 pllr11 pllr10 (bank1) pllr9 69h pllr8 pllr7 pllr6 (bank1) pllr5 6ah pllr4 pllr3 pllr2 (bank1) pllr1 6bh 0 fixed to 0 0 0 pll data set (bank1) w 0 fixed to 0 000 register 6ch 0 0 pllput data transfer to programmable counter does not transfer transfers pll unlock ff (bank1) r& 0 fixed to 0 urr register 6dh reset 0 0 pllul detects status of unlock ff locked status unlocked status note for the details of the set value, refer to figure 15-4 configuration of pll data register . remark u: undefined, r: previous status is retained. ? in direct division mode pllr6-pllr17: valid data pllr1-pllr5: dont care 0-15 (000h-00fh): setting prohibited 16-2 12 C 1 (010h-fffh): can be set note ? in pulse swallow mode pllr1-pllr17: valid data 0-1023 (0000h-03ffh): setting prohibited 1024-2 17 C 1 (0400h-1ffffh): can be set note 0:1 khz 1:3 khz 2:5 khz 3:6.25 khz 4:12.5 khz 5:25 khz 6, 7: pll disable CCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC C CCCCCCCC- CCCCCCCC - CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCCC C CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCCCCCC - 0011 disable mf vhf hf 0101 CCCC CCCCC CCCCCCCCC CCCCCCCC C CCCC CCCCC CCCCCCCCC CCCCCCCC C CCCC CCCCC CCCCCCCCC CCCCCCCC C CCCC CCCCC CCCCCCCCC CCCCCCCC C
m pd17072,17073 52 CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC - table 8-1. peripheral hardware control functions of peripheral control registers (3/4) peripheral control register peripheral hardware control function at reset hardware name address read/ b 3 functional outline set value power- clock ce write b 2 symbol on stop b 1 b 0 01 a/d a/d converter (bank1) r/w 0 fixed to 0 00 0 converter channel select 5ch 0 register adcch1 selects pin used for a/d converter adcch0 a/d converter (bank1) r/w adcrfsel3 sets compare voltage 0 0 0 reference 5dh adcrfsel2 voltage setting adcrfsel1 register adcrfsel0 a/d converter (bank1) r/w 0 fixed to 0 00 0 compare start 5eh 0 register 0 adcstrt invalid/stop starts/operates a/d converter (bank1) r 0 fixed to 0 00 0 compare result 5fh 0 detection register 0 adccmp detects compare result v adcin < v ref v adcin > v ref general- port 0b bit i/o (bank1) r/w p0bbio3 p0b3 pin input output 0 0 0 purpose select register 6eh p0bbio2 p0b2 pin port p0bbio1 p0b1 pin p0bbio0 p0b0 pin sets i/o mode of port 0c bit i/o (bank1) r/w p0dbio3 p0d3 pin these pins (bit i/o) select register 6fh p0dbio2 p0d2 pin p0cbio1 p0c1 pin p0cbio0 p0c0 pin serial serial i/o mode (bank1) r/w 0 fixed to 0 00 0 interface select register 60h siosel selects serial i/o mode of p0b3/si/so1 pin serial input serial output siohiz sets p1c0/so0 pin in serial output mode serial output siots sets start or stop of operation stops operation starts operation serial i/o clock (bank1) r/w 0 fixed to 0 00 0 select register 61h 0 siock1 sets clock of serial interface siock0 starts a/d converter operation/checks comparator operation 0011 not used ad0 ad1 ad1 0101 0011 external clock 12.5 khz 18.75 khz 37.5 khz 0101 CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C general-purpose output port CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC CCCC CCCCC v ref = x + 0.5 v dd (v) 16 (0 x 0fh)
53 m pd17072,17073 CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC - table 8-1. peripheral hardware control functions of peripheral control registers (4/4) peripheral control register peripheral hardware control function at reset hardware name address read/ b 3 functional outline set value power- clock ce write b 2 symbol on stop b 1 b 0 01 if counter if counter mode (bank1) r/w ifcmd1 sets mode of if counter 0 0 0 select register 62h ifcmd0 ifcck1 sets gate time of if counter ifcck0 if counter gate (bank1) r 0 fixed to 0 000 status detection 63h 0 register 0 ifcg detects opening/closing gate of if counter closed open if counter control (bank1) w 0 fixed to 0 000 register 64h 0 ifcstrt starts counting of if counter does not start starts ifcres resets if counter does not reset resets beep beep clock (bank1) r/w 0 fixed to 0 00r select register 5bh 0 beep0ck1 sets output status of beep pin beep0ck0 lcd lcd driver (bank1) r/w 0 fixed to 0 controller/ display start 50h 0 driver register adcon note sets a/d converter power supply and 0 0 0 lcden on/off of all lcd display 0 0 r standby system clock (bank1) r/w 0 fixed to 0 0rr select register 55h 0 0 sysck 53.3 m s 106.6 m s note when lcden= 1, the power supply for the a/d converter is on even if adcon = 0. remark r: previous status is retained. selects system clock (1 instruction execution time) 0011 general output port general output port beep beep (low-level output) (high-level output) (1.5 khz) (3 khz) 0101 0011 if counter off fmifc pin amifc pin fmifc pin (general i/o port) fmif mode amif mode amif mode 0101 0011 power off power on power on power on display off display on display off display on 0101 CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC - CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCCCC CCCCCCCC - CCCCCCCCCCC CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCCCCCC - CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCCCCCC- CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C CCCC CCCCC C C C 0011 1 ms 4 ms 8 ms open 0101
m pd17072,17073 54 9. data buffer (dbf) 9.1 general figure 9-1 outlines the data buffer. the data buffer is located on the data memory and has the following two functions: (1) reads constant data on program memory (table reference) (2) transfers data with hardware peripherals figure 9-1. outline of data buffer data buffer constant data program memory peripheral hardware table reference (movt instruction) data write (put instruction) data read (get instruction)
55 m pd17072,17073 9.2 data buffer 9.2.1 configuration of data buffer figure 9-2 shows the configuration of the data buffer. as shown in this figure, the data buffer is configured of 16 bits of addresses 0ch-0fh of bank0 on the data memory. of these 16 bits, bit 3 of address 0ch is the msb, while bit 0 of address 0fh is the lsb. since the data buffer is on the data memory, it can be manipulated by all the data memory manipulation instructions. figure 9-2. configuration of data buffer 0 0 123456789abcdef 1 2 3 4 5 6 7 column address row address data buffer (dbf) data memory bank0 bank1 system register 7 data memory data buffer address bit bit symbol data data m s b l s b 0ch dbf3 0dh dbf2 0eh dbf1 0fh dbf0 b 3 b 2 b 1 b 0 b 15 b 14 b 13 b 12 b 11 b 10 b 9 b 8 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 3 b 2 b 1 b 0 b 7 b 6 b 5 b 4
m pd17072,17073 56 9.2.2 table reference instruction (movt dbf, @ar) when this instruction is executed, the contents of the program memory addressed by the contents of the address register are incorporated into the data buffer. the program memory addresses to which table reference can be executed are addresses 0000h-0fffh, i.e., all the addresses of the program memory. 9.2.3 peripheral hardware control instructions (put and get) the operations of the put and get instructions are as follows: (1) get dbf, p reads the data of the peripheral register addressed by p to the data buffer. (2) put p, dbf sets the data of the data buffer to the peripheral register addressed by p. 9.3 list of peripheral hardware and data buffer functions table 9-1 lists the peripheral hardware and data buffer functions. 9.4 notes on using data buffer when transferring data with the peripheral hardware through the data buffer, keep in mind the following three points in respect with the unused peripheral addresses, write-only peripheral registers (only when using put), and read- only peripheral registers (only when using get): (1) an undefined value is read when a write-only register is read. (2) nothing is changed even when data is written to a read-only register. (3) an undefined value is read when an unused address is read. nothing is changed when data is written to this address. table 9-1. relation between peripheral hardware and data buffer peripheral peripheral register transferring data with data buffer function hardware name symbol peripheral execution no. of data no. of outline address of put/get buffer i/o actual instruction bits bits serial interface presettable shift siosfr 03h put/ 8 8 sets serial out data register get and reads serial in data address register address register ar 40h put/ 16 12 transfers data with (ar) get address register if counter if counter data ifc 43h get 16 16 reads count value of register if counter
57 m pd17072,17073 10. general-purpose port the general-purpose ports output high or low floating signals to external circuits, and reads high or low level signals from external circuits. 10.1 general table 10-1 shows the relations between each port and port register. the general-purpose ports are classified into i/o ports, input ports, and output ports. the i/o port is the bit i/o ports, which can be set in the input or output mode in 1-bit (1-pin) units. table 10-1. relations between each port (pin) and port register port pin data setting method no. symbol i/o port register (data memory) remarks 56-pin 64-pin bank address symbol bit symbol qfp tqfp (reserved word) port 0a 5 6 p0a3 output bank0 70h p0a b 3 p0a3 4 4 p0a2 b 2 p0a2 3 3 p0a1 b 1 p0a1 2 2 p0a0 b 0 p0a0 port 0b 56 64 p0b3 i/o 71h p0b b 3 p0b3 55 63 p0b2 (bit i/o) b 2 p0b2 54 62 p0b1 b 1 p0b1 53 61 p0b0 b 0 p0b0 port 0c no pin 72h p0c b 3 C fixed to 0 b 2 C 15 17 p0c1 i/o b 1 p0c1 14 16 p0c0 (bit i/o) b 0 p0c0 port 0d 17 19 p0d3 i/o 73h p0d b 3 p0d3 16 18 p0d2 (bit i/o) b 2 p0d2 no pin b 1 C fixed to 0 b 0 C port 1a 13 15 p1a3 input bank1 70h p1a b 3 p1a3 12 14 p1a2 b 2 p1a2 11 13 p1a1 b 1 p1a1 10 11 p1a0 b 0 p1a0 port 1b 9 10 p1b3 output 71h p1b b 3 p1b3 8 9 p1b2 b 2 p1b2 7 8 p1b1 b 1 p1b1 6 7 p1b0 b 0 p1b0 port 1c no pin 72h p1c b 3 C b 2 C fixed to 0 b 1 C 1 1 p1c0 output b 0 p1c0 73h C b 3 C test mode area. do not write b 2 1 to this area. b 1 b 0 CCCCCCCCC CCC CCCCCCCC CCCC CCCCCCC CCCCC CCCCCCCCC CCC CCCCCCCC CCCC CCCCCCC CCCCC CCCCCCCCC CCC CCCCCCCC CCCC CCCCCCC CCCCC CCCCCCCCC CCC CCCCCCCC CCCC CCCCCCC CCCCC CCCCC CCCCC CCCCC CCCCCCCCC CCC CCCCCCCC CCCCCCCCC CC CCCCCCCCCCCCCCCCCCC CCCCCCC CCCCC CCCCCCCCC CCC CCCCCCCC CCCCCCCCC CC CCCCCCCCCCCCCCCCCCC CCCCCCC CCCCC CCCCCCCCC CCC CCCCCCC CCCCC CCCCCCCC CCCCCCCCC CC CCCCCCCCCCCCCCCCCCC CCCCCCCCC CCCCCCCCC C - CCCCCCCC CCCCCCCCC CC - CCCCCCC CCCCCCCCC CCC - CCCCCCCCC CCCCCCCCC C - CCCCCCCC CCCCCCCCC CC - CCCCCCC CCCCCCCCC CCC - CCCCCCCCC CCCCCCCCC C - CCCCCCCC CCCCCCCCC CC - CCCCCCC CCCCCCCCC CCC - CCCCCCCCC CCCCCCCCC C - CCCCCCCC CCCCCCCCC CC - CCCCCCC CCCCCCCCC CCC - CCCCCCCCC CCCCCCCCC C CCCCCCCC C CCCCCCCC CC CCCCCCC CC- CCCCCCCCC C CCCCCCCC C- CCCCCCCC CC CCCCCCC CCCCCCCCCCC CCCCCCCCC CCCCCCCCC C CCCCCCCC C
m pd17072,17073 58 10.2 general-purpose i/o ports (p0b, p0c, p0d) 10.2.1 configuration of i/o ports the configurations of the i/o ports are shown below. p0b (p0b3, p0b2, p0b1, p0b0) p0c (p0c1, p0c0) p0d (p0d3, p0d2) i/o mode selector flag v dd v dd reset output latch 1 0 write instruction read instruction port register (1 bit) 10.2.2 use of i/o ports the i/o port is set in the input or output mode by the i/o select registers p0b and p0c of the control register. p0d, p0c, and p0d are the bit i/o ports. therefore, these ports can set in input or output mode in 1-bit units. to set output data or to read input data, data is written to the corresponding port register, or an instruction that reads the data is executed. 10.2.3 describes the configuration of the i/o select register of each port. 10.2.4 describes how to use an i/o port as an input port. 10.2.5 describes how to use an i/o port as an output port.
59 m pd17072,17073 10.2.3 control register of i/o port the port 0b bit i/o select register sets the input or output mode of each pin of p0b. the port 0c bit i/o select register sets the input or output mode of each pin of p0c and p0d. the following paragraphs (1) and (2) describe the configuration and function. (1) port 0b bit i/o select register name flag symbol address read/ write (bank1) 6eh r/w port 0b bit i/o select register 0 1 0000 0 0 power-on clock stop ce sets input or output mode sets p0b0 in input mode b 3 b 2 b 1 b 0 0 1 0 1 0 1 p 0 b b i o 3 000 000 p 0 b b i o 2 p 0 b b i o 1 p 0 b b i o 0 sets p0b0 in output mode sets input or output mode sets p0b1 in input mode sets p0b1 in output mode sets input or output mode sets p0b2/sck in input mode sets p0b2/sck in output mode sets input or output mode sets p0b3/si/so1 in input mode sets p0b3/si/so1 in output mode at reset
m pd17072,17073 60 (2) port 0c bit i/o select register name flag symbol address read/ write (bank1) 6fh r/w port 0c bit i/o select register 0 1 0000 0 0 power-on clock stop ce sets input or output of port sets p0c0 pin in input mode b 3 b 2 b 1 b 0 0 1 0 1 00 00 p 0 d b i o 2 p 0 c b i o 1 p 0 c b i o 0 sets p0c0 pin in output mode sets input or output of port sets p0c1 pin in input mode sets p0c1 pin in output mode sets input or output of port sets p0d2/amifc pin in input mode sets p0d2/amifc pin in output mode at reset sets input or output of port sets p0d3/fmifc/amifc pin in input mode sets p0d3/fmifc/amifc pin in output mode 0 0 0 1 p 0 d b i o 3
61 m pd17072,17073 10.2.4 to use i/o port in input mode the port pin to be used in the input mode is selected by the i/o select register of each port. the pin set in the input mode is floated (hi-z) and waits for the input of an external signal. the input data can be read by executing a read instruction (such as skt instruction) to the port register corresponding to each pin. 1 is read from the port register when the high level is input to the corresponding pin, and 0 is read from the register when the low level is input to the pin. if a write instruction (such as mov instruction) is executed to the port register corresponding to a port set in the input mode, the contents of the output latch are rewritten. 10.2.5 to use i/o port in output mode the port pin to be set in the output mode is selected by the i/o select register corresponding to the port. the pin set in the output mode outputs the contents of the output latch. the output data is set by executing a write instruction (such as mov instruction) to the port register corresponding to each pin. to output the high level to each pin, 1 is written to the port register, and to output the low level, 0 is written. the port pin can be floated (hi-z) by setting it in the input mode. if a read instruction (such as skt) is executed to the port register corresponding to a port set in the output mode, the contents of the output latch are read. 10.2.6 i/o port status on reset (1) on power-on reset all the ports are set in the input mode. the contents of the output latch become 0. (2) on ce reset all the ports are set in the input mode. the contents of the output latch are retained. (3) on execution of clock stop instruction all the ports are set in the input mode. the contents of the output latch are retained. increasing current consumption can be prevented due to noise of the input buffer, by using the reset signal, as described in 10.2.1. (4) in halt status the previous status is retained.
m pd17072,17073 62 10.3 general-purpose input ports (p1a) 10.3.1 configuration of input ports the configuration of the input ports is illustrated below. p1a (p1a3, p1a2, p1a1, p1a0) v dd write instruction read instruction port register (1 bit) reset to a/d converter p1apld3 p1apld2 p1apld1 p1apld0 high on resistance
63 m pd17072,17073 10.3.2 using input port the input data can be read by executing an instruction that reads the contents of the port register p1a (such as skt instruction). 1 is read from each bit of the port register when the high level is input to the corresponding port pin, and 0 is read when the low level is input. nothing is changed even if a write instruction (such as mov) is executed to the port register. port 1a can be connected to or disconnected from a pull-down resistor bitwise by software. whether the pull-down resistor is connected or disconnected is specified by the port 1a pull-down resistor select register. figure 10-1 shows the configuration and function of the port 1a pull-down resistor select register. figure 10-1. configuration of port 1a pull-down resistor select register flag symbol b 3 p 1 a p l d 3 b 2 p 1 a p l d 2 b 1 p 1 a p l d 1 b 0 p 1 a p l d 0 name port 1a pull-down resistor select register address (bank1) 53h read/ write r/w selects on/off of pull-down resistor of p1a0 pin pull-down resistor on pull-down resistor off 0 1 selects on/off of pull-down resistor of p1a1 pin pull-down resistor on pull-down resistor off 0 1 selects on/off of pull-down resistor of p1a2/ad0 pin pull-down resistor on pull-down resistor off 0 1 selects on/off of pull-down resistor of p1a3/ad1 pin pull-down resistor on pull-down resistor off 0 1 power-on clock stop ce 0 0 0 0 retained retained at reset
m pd17072,17073 64 10.3.3 reset status of input port (1) on power-on reset all pins are specified as a input port. pulled down internally. (2) on ce reset all pins are specified as a input port. the previous status of the pull-down resistor is retained. (3) on execution of clock stop instruction all pins are specified as a input port. the previous status of the pull-down resistor is retained. (4) in halt status the previous status is retained.
65 m pd17072,17073 10.4 general-purpose output ports (p0a, p1b, p1c) 10.4.1 configuration of output ports the configurations of the output ports are shown below. p0a (p0a3, p0a2, p0a1, p0a0) p1b (p1b3, p1b2, p1b1, p1b0) p1c (p1c0) 10.4.2 using output port the output port outputs the contents of the output latch from its pins. the output data is set by executing an instruction that writes data to the port register corresponding to each pin (such as mov instruction). 1 is written to each bit of the port register when the high level is output to the corresponding port pin, and 0 is written when the low level is output. if a read instruction (such as skt instruction) is executed to the port register, the contents of the output latch are read. 10.4.3 reset status of output port (1) on power-on reset all the pins output the contents of the output latch. the contents of the output latch become 0. (2) on ce reset retains the contents of the output latch. the contents of the output latch are retained; therefore, the output data is not changed on ce reset. (3) on execution of clock stop instruction retains the contents of the output latch. the contents of the output latch are retained; therefore, the output data is not changed on execution of the clock stop instruction. initialize the port through program as necessary. (4) in halt status the contents of the output latch are output. the contents of the output latch are retained; therefore, the output data is not changed in the halt status. v dd write instruction read instruction port register (1 bit) output latch
m pd17072,17073 66 11. interrupt 11.1 general figure 11-1 shows the outline of the interrupt block. as shown in this figure, the interrupt block temporarily stops the program under execution, and branches to an interrupt vector address according to an interrupt request output by each peripheral hardware. the interrupt block consists of interrupt control blocks that control interrupt requests output from the corresponding peripheral hardware, interrupt enable flip-flop that enables all the interrupts, stack pointer that is controlled when an interrupt is accepted, address stack register, program counter, and interrupt stack. the interrupt control block of each peripheral hardware consists of an interrupt request flag (irqxxx) that detects each interrupt, interrupt enable flag (ipxxx) that enables each interrupt, and vector address generator (vag) that specifies each vector address when an interrupt is accepted. the following peripheral hardware have the interrupt functions: ? int pin ? basic timer 1 ? serial interface figure 11-1. outline of interrupt block serial interface basic timer 1 int pin ip flag irq flag vector address generator 03h ipbtm1 flag irqbtm1 flag vector address generator 02h ipsio flag irqsio flag vector address generator 01h stack pointer program counter address stack register bank register di, ei instruction interrupt enable flip-flop interrupt stack interrupt control block
m pd17072,17073 67 11.2 interrupt control block an interrupt control block is available for each peripheral hardware. each of these blocks detects the presence/ absence of an interrupt request, enables/disables the interrupt, and generates a vector address when the interrupt is accepted. 11.2.1 interrupt request flag (irqxxx) the interrupt request flags are set to (1) when an interrupt request has been issued from the corresponding peripheral hardware, and is cleared (0) when the interrupt has been accepted. therefore, even when the interrupt is not enabled, whether an interrupt request has been issued can be detected by checking these interrupt request flags. writing 1 directly to an interrupt request flag is equivalent to issuance of an interrupt request. once this flag has been set, it will not be cleared until the corresponding interrupt has been accepted, or 0 is written to the flag by an instruction. if two or more interrupt requests are issued at the same time, the interrupt request flag corresponding to the interrupt request that has not been accepted is not cleared. the interrupt request flags are address 58h through 5ah of bank1 of ram. figures 11-2 through 11-4 show the configuration and functions of each interrupt request register. figure 11-2. configuration of int pin interrupt request register name int pin interrupt request register flag symbol b 3 b 2 b 1 b 0 0 i r q 0 0 address read/ write (bank1) 58h r/w sets interrupt request issuing status of int pin. interrupt request not issued. interrupt request issued. 0 1 fixed to "0". power-on clock stop ce at reset 0000 0 0
m pd17072,17073 68 figure 11-3. configuration of basic timer 1 interrupt request register power-on clock stop ce at reset 0000 0 0 name flag symbol b 3 b 2 b 1 b 0 address read/ write basic timer 1 interrupt request register i r q b t m 1 0 0 0 (bank1) 59h r/w sets interrupt request issuing status of basic timer 1. interrupt request not issued. interrupt request issued. 0 1 fixed to "0". power-on clock stop ce at reset 0000 0 0 name flag symbol b 3 b 2 b 1 b 0 address read/ write serial interface interrupt request register i r q s i o 0 0 0 (bank1) 5ah r/w sets interrupt request issuing status of serial interface. interrupt request not issued. interrupt request issued. 0 1 fixed to "0". figure 11-4. configuration of serial interface interrupt request register
m pd17072,17073 69 11.2.2 interrupt enable flag (ipxxx) each interrupt enable flag enables or disables the interrupt request of the corresponding peripheral hardware. so that an interrupt is accepted, all the following three conditions must be satisfied: ? the interrupt must be enabled by the corresponding interrupt enable flag. ? the interrupt request must be issued from the corresponding interrupt request flag. ? the ei instruction (which enables all the interrupts) must be executed. the interrupt enable flags are located on the interrupt enable registers on the register file. figure 11-5 shows the configuration and functions of the interrupt enable register. figure 11-5. configuration of interrupt enable register name flag symbol address read/ write (bank1) 57h r/w i p interrupt enable register 0 1 0000 0 0 power-on clock stop ce enables interrupt from int pin disables interrupt enables interrupt b 3 b 2 b 1 b 0 0 1 0 1 enables interrupt from serial interface fixed to 0 i p b t m 1 i p s i o 0 00 00 enables interrupt from basic timer 1 disables interrupt enables interrupt disables interrupt enables interrupt at reset
m pd17072,17073 70 11.2.3 vector address generator (vag) when an interrupt request from peripheral hardware has been accepted, the vector address generator generates a branch address (vector address) to which the program execution is to be branched. the vector addresses corresponding to each interrupt source are listed in table 11-1. table 11-1. vector address of each interrupt source interrupt source vector address int pin 03h basic timer 1 02h serial interface 01h 11.3 interrupt stack register 11.3.1 configuration and functions of interrupt stack register figure 11-6 shows the configuration of the interrupt stack register. the interrupt stack saves the contents of the bank registers when an interrupt has been accepted: when an interrupt has been accepted, and the contents of bank registers have been saved to the interrupt stack, the contents of the registers are reset to 0. the interrupt stack can save up to one level of the contents of the bank registers; therefore, multiplexed interrupt cannot be performed. the contents of the interrupt stack register are restored to the respective system registers when an interrupt return (reti) instruction has been executed. caution with the m pd17073, the contents of the program status word (psword) are not saved to the stack but retained when an interrupt is accepted. therefore, the contents of the program status word must be backed up by software. figure 11-6. configuration of interrupt stack register remark C: bit not saved interrupt stack register (intsk) name bit 0h bank stack b 3 _ b 2 _ b 1 _ b 0
m pd17072,17073 71 11.3.2 operations of interrupt stack figure 11-7 illustrates the operations of the interrupt stack. when multiplexed interrupts have been accepted, the first contents saved to the stack are popped. if these contents are necessary, therefore, they must be saved through program. figure 11-7. operations of interrupt stack undefined bank1 application of v dd interrupt a (bank1) reti interrupt a ( bank1 ) interrupt b ( bank0 ) reti reti (a) if interrupt level does not exceed 1 (b) if interrupt level exceeds 1 bank1 bank1 bank0 bank0 bank0
m pd17072,17073 72 11.4 stack pointer, address stack register, and program counter the address stack register saves the return address to which the program execution is to restore when execution exits from an interrupt service routine. the stack pointer specifies the address of the address stack register. when an interrupt has been accepted, therefore, the value of the stack pointer is decremented by one, and the value of the program counter at that time is saved to the address stack register specified by the stack pointer. next, when dedicated instruction reti has been executed after the interrupt service routine has been executed, the contents of the address stack register specified by the stack pointer are restored to the program counter, and the value of the stack pointer is incremented by one. also refer to 3. address stack (ask) . 11.5 interrupt enable flip-flop (inte) the interrupt enable flip-flop enables all the interrupts. when this flip-flop is set, all the interrupts are enabled. when it is reset, all the interrupts are disabled. this flip-flop is set or reset by dedicated instruction ei (set) or di (reset). the ei instruction sets this flip-flop when the instruction next to it has been executed, while the di instruction resets the flip-flop while it is executed. when an interrupt has been accepted, this flip-flop is automatically reset. this flip-flop is reset on power-on reset, execution of the clock stop instruction, or ce reset.
m pd17072,17073 73 11.6 accepting interrupt 11.6.1 interrupt accepting operation and priority an interrupt is accepted in the following sequence: (1) each peripheral hardware issues an interrupt request signal to an interrupt request block when a certain condition is satisfied (for example, when a falling signal has been input to the int pin). (2) each interrupt request block sets the corresponding interrupt request flag (e.g., irq flag for the int pin) to 1 when it has received an interrupt request signal from peripheral hardware. (3) when the interrupt request flag is set, the interrupt request block whose interrupt enable flag (e.g., ip flag for irq flag) is set to 1 outputs 1. (4) the signal output by the interrupt request block is ored with the output of the interrupt enable flip-flop and an interrupt accept signal is output. this interrupt enable flip-flop can be set to 1 by the ei instruction and reset to 0 by the di instruction. when 1 is output from an interrupt request block with the interrupt enable flip-flop set to 1, the interrupt enable flip-flop outputs 1 and the interrupt is accepted. when the interrupt has been accepted, the output of the interrupt enable flip-flop is input to the block that has issued the interrupt request, through an and circuit, as shown in figure 11-1. the signal input to the block that has issued the interrupt request clears the interrupt request flag of that block to 0, and a vector address corresponding to the interrupt is output. if any of the blocks that have issued an interrupt request outputs 1 at this time, the interrupt accept signal is not transmitted to the next stage. when two or more interrupt request have generated at the same time, therefore, the interrupts are accepted according to the following priority: int pin > basic timer 1 > serial interface the interrupt corresponding to an interrupt source is not accepted unless the interrupt enable flag is set to 1. therefore, by clearing the interrupt enable flag to 0, an interrupt with a high hardware priority can be disabled.
m pd17072,17073 74 11.6.2 timing to accept interrupt figure 11-8 is a timing chart illustrating how interrupts are accepted. (1) in this figure illustrate how one type of interrupt is accepted. (a) in (1) indicates the case where the interrupt request flag is set to 1 last, while (b) shows the case where the interrupt enable flag is set to 1 last. in either case, the interrupt is accepted after all the interrupt request flag, interrupt enable flip-flop, and interrupt enable flag have been set. if it is during the first instruction cycle of the movt dbf, @ar instruction or an instruction with the skip condition satisfied that sets the last flag or flip-flop to 1, the interrupt is accepted during the second instruction cycle of the movt dbf, @ar instruction or when the skipped instruction (nop) has been executed. the interrupt enable flip-flop is set in the instruction cycle next to the one in which the ei instruction is executed. (2) in figure 11-8 shows the timing chart where two or more interrupts are used. when using two or more interrupts, the interrupt given the highest hardware priority at that time is accepted if all the interrupt enable flags are set. however, the hardware priority can be changed by manipulating the interrupt enable flag through program. interrupt cycle in figure 11-8 is a special cycle in which the interrupt request flag is clear, a vector address is specified, and the contents of the program counter are saved after an interrupt has been accepted, and lasts for 53.3 m s, (normal operation) or one instruction execution time. for details, refer to 11.7 operations after accepting interrupt .
m pd17072,17073 75 figure 11-8. interrupt accepting timing chart (1/2) (1) when one type of interrupt (e.g., rising edge of int pin) is used instruction ei mov wr, #0001b poke intpm1, wr ordinary instruction interrupt cycle inte int pin irq flag ip flag 1 instruction cycle 53.3 s (normal operation) m interrupt enable period interrupt service routine interrupt accepted instruction ei inte int pin irq flag ip flag mov wr, #0001b poke intpm1, wr interrupt cycle interrupt service routine interrupt accepted interrupt pending period instruction ei mov wr, #0001b poke intpm1, wr interrupt cycle movt dbf,@ar skip instruction inte int pin irq flag ip flag interrupt enable period interrupt service routine (a) when there is no time to mask interrupt by interrupt enable flag (ipxxx) (b) when there is interrupt pending time by interrupt enable flag if an ordinary instruction which is not ?ovt?or does not satisfy the skip condition is executed when interrupt is accepted if ?ovt?or an instruction that satisfies the skip condition is executed when interrupt is accepted <1> <2> interrupt accepted
m pd17072,17073 76 figure 11-8. interrupt accepting timing chart (2/2) (2) when two or more interrupts are used (e.g., int pin and basic timer 1) note because the level of the interrupt stack is 1, multiplexed interrupt cannot be performed. instruction ei ei mov wr, #0011b poke intpm1, wr interrupt cycle interrupt cycle inte int pin irq flag basic timer 1 irqbtm1 flag ip flag ipbtm1 flag int pin interrupt pending period int pin interrupt service routine basic timer 1 interrupt pending period int pin interrupt accepted basic timer 1 interrupt service basic timer 1 interrupt accepted instruction inte int pin irq flag basic timer 1 irqbtm1 flag ip flag ipbtm1 flag mov wr, #0010b poke intpm1, wr ei interrupt cycle interrupt cycle ei mov wr, #0011b poke intpm1, wr int pin interrupt pending period basic timer 1 interrupt pending period basic timer 1 interrupt service routine basic timer 1 interrupt accepted int pin interrupt accepted int pin interrupt service (a) hardware priority (b) software priority reti note reti note
m pd17072,17073 77 11.7 operations after accepting interrupt when an interrupt has been accepted, the following processing is automatically executed in sequence: (1) the interrupt enable flip-flop and the interrupt request flag corresponding to the accepted interrupt request are cleared to 0. therefore, the interrupt is disabled. (2) the contents of the stack pointer are decremented by one. (3) the contents of the program counter are saved to the address stack register specified by the stack pointer. at this time, the content of the program counter is the program memory address next to the one at which the interrupt has been accepted. for example, if the interrupt has been accepted while a branch instruction is executed, the branch destination address is loaded to the program counter. if a subroutine call instruction is executed when the interrupt has been accepted, the address that called the subroutine is loaded to the program counter. when the skip condition of a skip instruction is satisfied, the next instruction is treated as a no-operation instruction (nop) and then the interrupt is accepted. consequently, the contents of the program counter are the skipped address. (4) the lower 1 bit of the bank register (bank) is saved to the interrupt stack. caution at this time, the contents of the program status word (psword) are not saved. save the contents of the program status word by software as necessary. (5) the contents of the vector address generator corresponding to the accepted interrupt are transferred to the program counter. therefore, the execution branches to an interrupt service routine. the above steps (1) through (5) are executed in one special instruction cycle (53.3 m s: normal operation) that does not involve execution of an ordinary instruction. this instruction cycle is called an interrupt cycle. therefore, it takes the cpu one instruction cycle to branch to the corresponding vector address after it has accepted an interrupt.
m pd17072,17073 78 11.8 exiting from interrupt service routine to return to the service that was executed when the interrupt was accepted from the interrupt service routine, a dedicated instruction reti is used. when this instruction is executed, the following processing is automatically executed in sequence: (1) the contents of the address stack register specified by the stack pointer are restored to the program counter. (2) the contents of the interrupt stack are restored to the lower 1 bit of the bank register (bank). caution if the contents of the program status word are saved in the program, its contents must be restored to the program status word at the same time. (3) the contents of the stack pointer are incremented by one. the processing (1) through (3) above is executed in one instruction cycle during which the reti instruction is executed. the only difference between the reti and subroutine return instructions ret and retsk is the restore operation of each system register described in step (2) above.
m pd17072,17073 79 11.9 external (int pin) interrupts 11.9.1 outline of external interrupts figure 11-9 outlines the external interrupts. as shown in this figure, an interrupt request for an external interrupt is issued at the rising or falling edge of the signal input to the int pin. whether the interrupt request is to be issued at the rising or falling edge of int is specified independently through program. the int pin is schmitt trigger input pin to protect malfunctioning due to noise. this pin do not accept a pulse input that lasts for less than 100 ns. figure 11-9. outline of external interrupt remark int: detects pin status ieg: selects interrupt edge 11.9.2 edge detection block the edge detection block specifies the edge (rising or falling edge) of the input signal that issues the external interrupt request of the int pin, and detects the specified edge. the edge is specified by ieg flag. figure 11-10 shows the configuration and function of the interrupt edge select register. int pin int flag schmitt trigger ieg flag edge detection block irq flag interrupt control block
m pd17072,17073 80 figure 11-10. configuration of interrupt edge select register note for the function of the btm1ck flag, refer to 12.3.1 outline of basic timer 1 . note that as soon as the interrupt request issuing edge is changed by the ieg flag, the interrupt request signal may be issued. suppose that the ieg flag is set to 1 (specifying the falling edge) and that a high level is input to the int pin, as shown in table 11-2. if the ieg flag is cleared at this time, the edge detector circuit judges that a rising edge has been input, and issues an interrupt request. flag symbol b 3 0 b 2 i n t b 1 b t m 1 c k b 0 i e g name address (bank1) 56h read/ write r/w sets input edge to issue interrupt request of int pin rising edge falling edge 0 1 sets time interval at which irqbtm1 flag is set note 32 ms (31.25 hz) 8 ms (125 hz) 0 1 detects status of int pin low level is input to int pin high level is input to int pin 0 1 fixed to ? power-on clock stop ce 0 0 0 0 0 0 0 0 0 0 interrupt edge select register at reset
m pd17072,17073 81 table 11-2. issuing interrupt request by changing ieg flag 11.9.3 interrupt control block the level of a signal input to the int pin can be detected by using the int flag. this flag is set or cleared independently of interrupts; therefore, it can be used as a 1-bit general-purpose input port when the interrupt function is not used. the int flag can also be used as a general-purpose port that can detect the rising or falling edge by reading an interrupt request flag if the interrupt corresponding to the flag is not enabled. in this case, however, the interrupt request flag is not automatically cleared and must be cleared by program. also refer to figure 11-10 . 11.10 internal interrupt two internal interrupt sources, basic timer 1, and serial interface, are available. 11.10.1 interrupt by basic timer 1 this interrupt request is issued at fixed time intervals. for details, refer to 12. timer . 11.10.2 interrupt by serial interface this interrupt request is issued when a serial output or serial input operation has been completed. for details, refer to 14. serial interface . 1 ? 0 (falling) (rising) 0 ? 1 (rising) (falling) changes in ieg flag int pin status interrupt request irq flag status low level not issued retains previous status high level issued set to 1 low level issued set to 1 high level not issued retains previous status
m pd17072,17073 82 12. timer the timers are used to control the program execution time. 12.1 general as shown in this figure, the m pd17013 is provided with the following two timers: ? basic timer 0 ? basic timer 1 the basic timer 0 is used to detect the status of a flip-flop that is set at fixed time intervals. the basic timer 1 is used to issue an interrupt request at fixed time intervals. the basic timer 0 can also be used to detect a power failure. the clock of each timer is generated by dividing the system clock (75 khz). 12.2 basic timer 0 12.2.1 general figure 12-1 outlines the basic timer 0. the basic timer 0 is used as a timer by detecting the status of a flip-flop which is set at fixed time intervals, by using the btm0cy flag (bank1 of ram: address 51h, bit 0). the content of the flip-flop corresponds to the btm0cy flag on a one-to-one basis. the set time for btm0cy flag (btm0cy flag set pulse) is 125 ms (8 hz). if the btm0cy flag is read for the first time after power-on reset, its content is always 0. after that, the flag is set to 1 at fixed time intervals. if the ce pin goes high, ce reset is effected when the btm0cy flag is set next time. by reading the content of the btm0cy flag at system reset (power-on reset and ce reset), therefore, a power failure can be detected. for details on power failure detection, refer to 20. reset . figure 12-1. outline of basic timer 0 divider 125 ms (8 hz) 75 khz basic timer 0 carry ff set/clear btm0cy flag remark btm0cy (bit 0 of basic timer 0 carry register: refer to figure 12-2 ) detects the status of the flip-flop.
m pd17072,17073 83 12.2.2 flip-flop and btm0cy flag the flip-flop is set at fixed time intervals and its status is detected by the btm0cy flag of the basic timer 0 carry register. the btm0cy flag is a read-only flag, and is reset to 0 if its contents are read (read & reset) by using the instructions shown in table 12-1. the btm0cy flag is reset to 0 at power-on reset, and is set to 1 at ce reset and at ce reset after the clock stop instruction is executed. therefore, this flag can be used as a power failure detection flag. the btm0cy flag is not set until its contents are read by the instruction shown in table 12-1 after application of the supply voltage. once a read instruction has been executed, this flag is set at fixed time intervals. figure 12-2 shows the configuration and function of the basic timer 0 carry register. table 12-1. instructions to reset btm0cy flag mnemonic operand mnemonic operand add m, #n4 add r, m addc addc sub sub subc subc and and or or xor xor ske ld skeg skt m, #n sklt skf skne mov @r, m m, @r note note when the row address of m is 5h and 1h is written to r. remark m = 51h
m pd17072,17073 84 figure 12-2. configuration of basic timer 0 carry register 12.2.3 application example of basic timer 0 an example of a program in which the basic timer 0 is used is shown below. in this example, processing a is executed every 1 second. example m1 mem 1.10h ; 1-second counter, set to bank 1 loop: bank1 skt1 btm0cy ; branches to next if btm0cy flag is 0 br next add m1, #0010b ; adds 2 to m1 skt1 cy ; executes processing a if cy flag is 1 br next ; branches to next if cy flag is 0 processing a next: processing b br loop ; executes processing b and branches to loop name flag symbol b 3 b 2 b 1 b 0 address read/ write basic timer 0 carry register 000 b t m 0 c y (bank1) 51h r&reset detects status of flip-flop. flip-flop is not set. 0 flip-flop is set. 1 fixed to "0". power-on clock stop ce at reset 0000 1 1
m pd17072,17073 85 12.2.4 error of basic timer 0 the time at which the btm0cy flag is to be detected must be shorter than the time at which the btm0cy flag is to be set (refer to 12.2.5 notes on using basic timer 0 ). where the time interval at which the btm0cy flag is to be detected is t check and the time interval at which the btm0cy flag is to be set (125 ms) is t set , the relation between t check and t set must be as follows: t check < t set at this time, as shown in figure 12-3, the timer error when the btm0cy flag is detected is: 0 < error < t set figure 12-3. error of basic timer 0 due to detection time of btm0cy flag h l 1 0 btm0cy flag setting pulse btm0cy flag t set t check1 t check2 t check3 skt1 btm0cy <1> skt1 btm0cy <2> skt1 btm0cy <3> skt1 btm0cy <4> as shown in figure 12-3, the timer is updated because the btm0cy flag is detected as 1 in <2>. in <3>, the flag is 0; therefore, the timer is not updated until the btm0cy flag is detected again in <4>. at this time, the time of the timer is extended by t check3 .
m pd17072,17073 86 12.2.5 notes on using basic timer 0 (1) btm0cy flag detection time interval the time interval at which the btm0cy flag is to be detected must be shorter than the time interval at which the flag is to be set. this is because, if the time of processing b in figure 12-4 is longer than the time interval at which the btm0cy flag is to be set, the btm0cy flag is not set accurately. figure 12-4. detection of btm0cy flag and btm0cy flag btm0cy flag setting pulse h 1 l 0 btm0cy flag <1> <2> <3> <5> <4> skt1 btm0cy skt1 btm0cy skt1 btm0cy processing b processing a because execution time of processing b is too long after btm0cy flag, which has been set to "1" in step <2> above, has been detected, btm0cy flag is not detected in step <3>. (2) sum of timer updating processing time and btm0cy flag detection time interval as described in (1) above, the time interval t check at which the btm0cy flag is to be detected must be shorter than the time at which the btm0cy flag is to be set. at this time, even if the time interval at which the btm0cy flag is to be detected is short, the timer processing may not be executed normally when ce reset is effected if the updating processing time of the timer is long. therefore, the following conditions must be satisfied: t check + t timer < t set where, t check : time interval at which btm0cy flag is detected t timer : timer updating processing time t set : time interval at which btm0cy flag is set an example is shown below.
m pd17072,17073 87 example timer updating processing and btm0cy flag detection time interval btimer: bank1 skt1 btm0cy ; executes timer updating processing if btm0cy flag is 1. br aaa ; branches to aaa if btm0cy flag is 0. timer updating br btimer aaa: processing a br btimer the following is the timing chart of the above program. ce pin h l btm0cy flag setting pulse h l btm0cy flag 0 1 btm0cy detection interval skt1 btm0cy skt1 btm0cy t check timer updating processing t timer ce reset if this timer updating processing time is too long, ce reset is effected while processing is in progress.
m pd17072,17073 88 (3) adjusting basic timer 0 at ce reset an example of adjusting the basic timer 0 at ce reset is shown on the next page. as shown in this example, the timer may have to be adjusted if the btm0cy flag is used for power failure detection and, at the same time, the flag is used for a watch timer. when the power is applied the first time (power-on reset), the btm0cy flag is cleared to 0, and not set until the contents of the flag is read again by an instruction shown in table 12-1. if the ce pin goes high, ce reset is effected in synchronization with rising edge of the btm0cy flag setting pulse. at this time, the btm0cy flag is set to 1 and starts. therefore, it can be judged, when system reset (power-on reset or ce reset) has been effected, whether the system reset is power-on reset or ce reset, by checking the status of the btm0cy flag. that is, if the btm0cy flag is 0, power-on reset has been effected; if the flag is 1, ce reset has been effected (for power failure detection). at this time, the watch timer must continue its operation even when ce reset has been effected. however, because the btm0cy flag is cleared to 0 as a result of reading the btm0cy flag to detect a power failure, the set (1) status of the btm0cy flag is overlooked once. consequently, it is necessary to update the watch timer if ce reset has been detected as a result of power failure detection. for details on power failure detection, refer to 20.6 power failure detection . example adjusting timer at ce reset (to detect power failure and update watch by btm0cy flag) start: ; program address 0000h processing a ; <1> bank1 skt1 btm0cy ; embedded macro ; tests btm0cy flag. br initial ; if btm0cy is 0, branches to initial (power failure detection). backup: ; <2> updates watch 125 ms. ; adjusts watch because this is back up (ce reset) loop: ; <3> processing b ; while performing processing b, skf1 btm0cy ; tests btm0cy flag and updates watch. br backup br loop initial: processing c ; initialization of ports and peripheral hardware. br loop figure 12-5 shows the timing chart of the above program.
m pd17072,17073 89 figure 12-5. timing chart as shown in figure 12-5, the program is started from address 0000h in synchronization with the rising of the internal 8-hz pulse when supply voltage v dd is applied first. when the btm0cy flag is detected next at point a, the btm0cy flag is cleared to 0 because power has been just applied. it is therefore judged that a power failure (i.e., power-on reset) has been detected, and processing c is executed. because the content of the btm0cy flag has been read once at point a, the btm0cy flag is set to 1 every 125 ms afterward. next, even if the ce pin goes low at point b and goes high at point c, the program executes processing b and increments the watch, unless the clock stop instruction is executed. because the ce pin goes high at point c, ce reset is effected at point d where the btm0cy flag setting pulse rises, and the program is started from address 0000h. at this time, if the btm0cy flag is detected at point e, it is judged that back up (ce reset) has been effected, because the btm0cy flag is set to 1. as is evident from the above figure, the watch is delayed by 125 ms each time ce reset is effected, unless the watch is updated 125 ms at point e. if processing a takes 125 ms or longer when a power failure is detected at point e, setting of the btm0cy flag is overlooked two times; therefore, processing a must be completed within 125 ms. therefore, the btm0cy flag must be detected for a power failure detection within the btm0cy flag setting time after the program has been started from the address 0000h. 3 v 0 v l l h l 1 0 v dd ce h h internal pulse 8 hz program instruction program processing btm0cy flag btm0cy flag setting pulse power application power-on reset starts from address 0. watch up watch up watch up watch up watch up <3> <3> <1> <3><3> <3> <3> <3> <3> <3> <3> <3> <3> <1> btm0cy flag detection point a point b point c point d point e ce reset starts from address 0. btm0cy flag is detected. time updated because flag is set to 1. ac b b b bb b b b b b b a b b
m pd17072,17073 90 (4) if detection of btm0cy flag overlaps with ce reset as described in (3), the ce reset is effected as soon as the btm0cy flag has been set to 1. if the btm0cy flag read instruction happens to be executed at the same time as the ce reset, the btm0cy flag read instruction takes precedence. therefore, if setting of the btm0cy flag after the ce pin has gone high overlaps with the btm0cy flag read instruction, the ce reset is effected when the btm0cy flag is set next time. this operation is illustrated in figure 12-6. figure 12-6. operation when ce reset and btm0cy flag read instruction overlap in a program that cyclically detects the btm0cy flag, in which the btm0cy flag detection time interval coincides with the btm0cy flag setting time, ce reset is never effected. h l h l 1 0 ce pin btm0cy flag setting pulse btm0cy flag skt 1 btm0cy skt 1 btm0cy ce reset h l 1 0 btm0cy flag setting pulse btm0cy flag instruction skt1 btm0cy 53.3 s m embedded macro skt .mf. btm0cy shr4, #.df. btm0cy and 0fh if btm0cy flag is read during this period, ce is delayed. originally, program starts from address 0000h here. however, because it happens to overlap with a program that reads btm0cy, ce reset is not effected.
m pd17072,17073 91 12.3 basic timer 1 12.3.1 general figure 12-7 outlines the basic timer 1. the basic timer 1 issues an interrupt request at fixed time interval and sets the irqbtm1 flag to 1. the time interval of the irqbtm1 flag is set by the btm1ck flag of the interrupt edge select register. figure 12- 8 shows the configuration and function of the interrupt edge select register. the interrupt generated by the basic timer 1 is accepted when the irqbtm1 flag is set, if the ei instruction has been issued and the ipbtm1 flag has been set (refer to 11. interrupt ). figure 12-7. outline of basic timer 1 remark btm1ck (bit 1 of interrupt edge select register. refer to figure 12-8 ) set the time interval at which the irqbtm1 flag is set. selector divider btm1ck flag internal signal 75 khz (fixed) irqbtm1 set signal 32 ms (31.25 hz) 8 ms (125 hz)
m pd17072,17073 92 figure 12-8. configuration of interrupt edge select register note for the functions of ieg and int flags, refer to 11.9 external (int pin) interrupt . flag symbol b 3 0 b 2 i n t b 1 b t m 1 c k b 0 i e g name address (bank1) 56h read/ write r/w sets input edge to issue interrupt request of int pin note rising edge falling edge 0 1 sets time interval at which irqbtm1 flag is set 32 ms (31.25 hz) 8 ms (125 hz) 0 1 detects status of int pin note low level is input to int pin. high level is input to int pin. 0 1 fixed to ?? power-on clock stop ce 0 0 0 0 0 0 0 0 0 0 interrupt edge select register at reset
m pd17072,17073 93 12.3.2 application example of basic timer 1 a program example is shown below. example m1 mem 0.10h ; 80-ms counter btimer1 dat 0002h ; symbol definition of basic timer 1 interrupt vector address br start ; branches to start org btimer1 ; program address (0002h) add m1, #0001b ; adds 1 to m1 skt1 cy ; tests cy flag br ei_reti ; returns if no carry mov m1, #0110b processing a ei_reti: ei reti start: mov m1, #0110b ; initializes contents of m1 to 6 bank1 set1 btm1ck ; embedded macro ; sets basic timer 1 interrupt pulse to 8 ms set1 ipbtm1 ; enables basic timer 1 interrupt ei ; enables all interrupts loop: bank0 processing b br loop this program executes processing a every 80 ms. the points to be noted in this case are that the di status is automatically set when an interrupt has been accepted, and that the irqbtm1 flag is set to 1 even in the di status. this means that the interrupt is accepted even if execution exits from an interrupt service routine by execution of the reti instruction, if processing a takes longer than 8 ms. consequently, processing b is not executed.
m pd17072,17073 94 12.3.3 error of basic timer 1 as described in 12.3.2, the interrupt generated by basic timer 1 is accepted each time the basic timer 1 interrupt pulse falls, if the ei instruction has been executed, and if the interrupt has been enabled. therefore, an error of basic timer 1 occurs only when any of the following operations are performed: ? when the first interrupt after basic timer 1 interrupt has been enabled has been accepted ? when the time interval at which the irqbtm1 flag is to be set is changed, i.e., when the first interrupt is accepted after the interrupt pulse has been changed ? when data has been written to the irqbtm1 flag figure 12-9 shows an error in each of the above operations. figure 12-9. error of basic timer 1 (1/2) (a) when interrupt by basic timer 1 is enabled at point <1> in the above figure, the interrupt by basic timer 1 is accepted as soon as the interrupt is enabled. at this time, the error is Ct set . if an interrupt is enabled by the ei instruction at the next point <3>, the interrupt occurs at the falling edge of the basic timer 1 interrupt pulse. at this time, the error is: Ct set < error < 0 h <1> <2> <3> l 1 0 1 0 ei di ei ei interrupt pending set1 ipbtm1 interrupt accepted interrupt accepted interrupt accepted ei t set basic timer 1 interrupt pulse irqbtm1 flag ipbtm1 flag inte ff
m pd17072,17073 95 figure 12-9. error of basic timer 1 (2/2) (b) when basic timer 1 interrupt pulse is changed h l ei ei ei ei h l h l 1 0 1 0 ei di internal pulse a internal pulse b basic timer 1 interrupt pulse irqbtm1 flag ipbtm1 flag inte ff <1> basic timer 1 interrupt pulse changed <2> interrupt accepted <3> basic timer 1 interrupt pulse changed interrupt accepted interrupt accepted even if the basic timer 1 interrupt pulse is changed to b at point <1> in the above figure, the interrupt is accepted at the next point <2> because the basic timer 1 interrupt pulse does not fall. if the basic timer 1 interrupt pulse is changed to a at <3>, the interrupt is immediately accepted because the basic timer 1 interrupt pulse falls. (c) when irqbtm1 flag is manipulated h l basic timer 1 interrupt pulse irqbtm1 flag ipbtm1 flag inte ff ei ei ei 1 0 1 0 ei di <1> set1 irqbtm1 interrupt accepted interrupt accepted interrupt accepted <2> clr1 irqbtm1 interrupt not accepted the interrupt is immediately accepted if the irqbtm1 flag is set to 1 at <1>. if clearing the irqbtm1 flag to 0 overlaps with the falling of the basic timer 1 interrupt pulse at <2>, the interrupt is not accepted.
m pd17072,17073 96 12.3.4 notes on using basic timer 1 when creating a program, such as a program for watch, in which processing is always performed at fixed time intervals by using the basic timer 1 after the supply voltage has been once applied (power-on reset), the basic timer 1 interrupt service must be completed in a fixed time. lets take the following example: example m1 mem 0.10h ; 80-ms counter btimer1 dat 0002h ; symbol definition of interrupt vector address of basic timer 1 br start ; branches to start org btimer1 ; program address (0002h) add m1, #0001b ; adds 1 to m1 skt1 cy ; watch processing if carry occurs br ei_reti ; restores if no carry occurs mov m1, #0110b ; <1> processing b ei_reti: ei reti start: mov m1, #0110b ; initializes contetns of m1 to 6 bank1 set1 btm1ck ; embedded macro ; sets time of interrupt by basic timer 1 to 8 ms set1 ipbtm1 ; embedded macro ; enables interrupt by basic timer 1 ei ; enables all interrupts loop: processing a br loop in this example, processing b is executed every 80 ms while processing a is executed. if the ce pin goes high as shown in figure 12-10, ce reset is effected in synchronization with the rising of the btm0cy flag setting pulse. if issuance of an interrupt request by the basic timer 1 happens to overlap with the setting of the btm0cy flag at this time, ce reset takes precedence. when ce reset is effected, the basic timer 1 interrupt request (irqbtm1) flag is cleared. consequently, the timer processing is skipped once.
m pd17072,17073 97 figure 12-10. timing chart h l h l h l ce pin btm0cy flag setting pulse basic timer 1 interrupt pulse basic timer 1 interrupt because btm0cy flag setting pulse rises, ce reset is effected here. as a result, basic timer 1 interrupt is skipped once.
m pd17072,17073 98 13. a/d converter 13.1 general figure 13-1 outlines the a/d converter. the a/d converter compares an analog voltage input to the ad0 or ad1 pins with the internal compare voltage, judge the comparison result via software, and converts the analog signal into a 4-bit digital signal. the comparison result can be detected by the adccmp flag. as the comparison method, successive approximation is employed. figure 13-1. outline of a/d converter compare block adcch1 flag adcch0 flag input selector block p1a2/ad0 p1a3/ad1 compare voltage generator block (r-string d/a converter) set/reset adccmp flag remarks 1. adcch0 and adcch1 (bits 0 and 1 of a/d converter channel select register. refer to figure 13- 4 ) select the pin used for the a/d converter. 2. adccmp (bit 0 of a/d converter compare result detection register. refer to figure 13-7 ) detects the result of comparison.
m pd17072,17073 99 13.2 setting a/d converter power supply the m pd17073 has a power supply for the a/d converter. this power supply is also used for lcd display. when using the a/d converter, therefore, the a/d converter power supply must be set to on by using the adcon flag of the lcd driver display start register. figure 13-2 shows the configuration and function of the lcd driver display start register. figure 13-2. configuration of lcd driver display start register remark r: retained cautions 1. when the lcd display is on (lcden = 1), the a/d converter power supply is on regardless of the setting of the adcon flag. 2. bit 3 of the lcd driver display start register is a test mode area. therefore, do not write 1 to this bit. 0 1 0 1 flag symbol b 3 0 b 2 0 b 1 a d c o n b 0 l c d e n name address (bank1) 50h read/ write r/w turns on/off a/d converter power supply and all lcd displays a/d converter power supply off, lcd display off a/d converter power supply on, lcd display on a/d converter power supply on, lcd display off a/d converter power supply on, lcd display on 0 0 1 1 fixed to 0 . 0 0 r 0 0 0 0 0 lcd driver display start register power-on clock stop ce at reset
m pd17072,17073 100 13.3 input selector block figure 13-3 shows the configuration of the input selector block. the input selector block selects the pin to be used by using the a/d converter channel select register. two or more pins cannot be used at the same time with the a/d converter. figure 13-4 shows the configuration and function of the a/d converter channel select register. for the configuration and function of the port 1a pull-down resistor select register, refer to figure 10-1 port 1a pull-down resistor select register . figure 13-3. configuration of input selector block compare block v adcin adcch1 flag adcch0 flag selector each i/o port p1a2/ad0 p1a3/ad0
m pd17072,17073 101 figure 13-4. configuration of a/d converter channel select register name a/d converter channel select register flag symbol b 3 b 2 b 1 b 0 0 r/w address read/ write sets pins used for a/d converter a/d converter is not used (general-purpose input port) p1a2/ad0 0 1 at reset power-on clock stop ce 0000 a d c c h 1 (bank1) 5ch fixed to "0" 0 a d c c h 0 0 1 0 0 1 1 p1a3/ad1 pin p1a3/ad1 pin 00 00
m pd17072,17073 102 13.4 compare voltage generator block and compare block figure 13-5 shows the configuration of the compare voltage generator block and compare block. the compare voltage generator block switches over the tap decoder by using 4-bit data set to the a/d converter reference voltage setting register to generate 16 steps of compare voltage v ref . in other words, this block is an r-string d/a converter. the power source of the r string is the same as v dd that is supplied to the device. the compare block judges which of the voltage v adcin input from a pin and compare voltage v ref is greater. data is compared by the comparator as soon as the adcstrt flag has been written to. one compare time of the a/d converter is equal to two instruction execution times (106.6 m s in normal operation mode, and 213.2 m s in the low-speed mode). by reading the content of the adcstrt flag, the current operating status of the comparator can be checked. the compare result is detected by the adccmp flag. figure 13-6 shows the configuration and function of the a/d converter compare start register. figures 13-7 and 13-8 show the configuration and function of the a/d converter compare result detection register and a/d converter reference voltage setting register. table 13-1 lists the compare voltages. figure 13-5. configuration of compare voltage generator block and compare block a/d converter reference voltage setting register (adcr) tap decoder v dd v adcin v ref 2pf comparator 1/2 v dd rr adccmp flag _ + 01ef 2 1 r 2 1 r write to adcstrt flag
m pd17072,17073 103 figure 13-6. configuration of a/d converter compare start register name flag symbol b 3 0 b 2 0 b 1 0 b 0 a d c s t r t address (bank1) 5eh read/ write r/w read checks operating status of comparator operation stops (compare completes) operating (analog voltage comparison in progress) 0 1 fixed to 0 a/d converter compare start register 0 0 0 0 0 0 write sets start of compare operation by comparator invalid start power-on clock stop ce at reset remarks 1. even if the a/d converter channel select register or a/d converter reference voltage setting register is manipulated when adcstrt = 1 (when comparison by the comparator is in progress), the contents of the register remain unchanged. therefore, the operating status of the a/d converter cannot be changed while the comparator is operating. 2. the adcstrt flag is cleared to 0 only when the voltage comparison operation by the comparator is completed or when the stop s instruction is executed.
m pd17072,17073 104 figure 13-7. configuration of a/d converter compare result detection register name flag symbol address read/ write (bank1) 5fh r 000 a d c c m p a/d converter compare result detection register 0 1 000 power-on clock stop ce detects result of comparison by a/d converter v adcin < v ref fixed to "0" b 3 b 2 b 1 b 0 v adcin > v ref at reset 0 0 0
m pd17072,17073 105 figure 13-8. configuration of a/d converter reference voltage setting register flag symbol b 3 a d c r f s e l 3 b 2 a d c r f s e l 2 b 1 a d c r f s e l 1 b 0 a d c r f s e l 0 name address (bank1) 5dh read/ write r/w sets compare voltage of a/d converter v ref = v dd (v) 0 | x | 0fh power-on clock stop ce 0 0 0 0 0 0 0 0 0 0 0 0 a/d converter reference voltage setting register x + 0.5 16 at reset
m pd17072,17073 106 table 13-1. set value of a/d converter reference voltage setting register and compare voltage a/d converter reference compare voltage voltage setting register set data decimal hexadecimal logic voltage at v dd = 3 v (dec) (hex) unit: v dd v unit: v 0 00h 0.5/16 0.094 1 01h 1.5/16 0.281 2 02h 2.5/16 0.469 3 03h 3.5/16 0.656 4 04h 4.5/16 0.844 5 05h 5.5/16 1.031 6 06h 6.5/16 1.219 7 07h 7.5/16 1.406 8 08h 8.5/16 1.594 9 09h 9.5/16 1.781 10 0ah 10.5/16 1.969 11 0bh 11.5/16 2.156 12 0ch 12.5/16 2.344 13 0dh 13.5/16 2.531 14 0eh 14.5/16 2.719 15 0fh 15.5/16 2.906
m pd17072,17073 107 13.5 comparison timing chart the adcen flag is automatically cleared to 0 when the comparison operation has been completed. the adcstrt flag is reset to 0 two instructions after the adcstrt flag has been set. at this point, the compare result (adccmp flag) can be read. figure 13-9 shows the timing chart. figure 13-9. timing chart of a/d converters compare operation 13.6 performance of a/d converter table 13-2 shows the performances of the a/d converter. table 13-2. performances of a/d converter parameter performance resolution 4 bits input voltage range 0-v dd quantization error 1/2 lsb over range 15.5/16 v dd error of offset, gain, and non-linearity 3/2 lsb note note including quantization error instruction cycle sample & hold adcstrt flag adccmp flag comparison result a/d converter start instruction nop nop adccmp read a/d converter start instruction
m pd17072,17073 108 13.7 using a/d converter 13.7.1 comparing one reference voltage the following shows a program example. example to compare voltage input to ad0 pin, v adcin against reference voltage v ref (8.5/16 v dd ). if v adcin >v ref , execution branches to aaa; if v adcin < v ref , execution branches to bbb. bank1 set1 adcon ; a/d converter on initflg not adcch1, adcch0 ; p1a2/ad0 pin used as a/d converter pin initflg adcrfsel3, not adcrfsel2, not adcrfsel1, not adcrfsel0 ; sets compare voltage v ref to 8.5/16 v dd set1 adcstrt ; a/d operation starts nop ; comparison in progress nop ; comparison in progress skt1 adccmp ; detects adccmp flag and, br aaa ; branches to aaa if false (0) br bbb ; branches to bbb if true (1)
m pd17072,17073 109 13.7.2 successive comparison by means of binary search the a/d converter can compare only one reference voltage at a time. consequently, successive comparison must be executed through program in order to convert input voltages into digital signals. if the processing time of the successive comparison program is different depending on the input voltage, it is not desirable because of the relations with the other programs. therefore, the binary search method described in (1) through (3) below is useful. (1) concept of binary search the following figure illustrates the concept of binary search. first, the reference voltage is set to 1/2v dd . if the result of comparison is true (high level), a voltage of 1/ 4v dd is applied; if the result is false (low level), a voltage of 1/4v dd is subtracted for comparison. similarly, comparison is performed in sequence from 1/8v dd to 1/16v dd . if the result is false after comparison has been executed six times, 1/64v dd is subtracted, and the comparison ends. 11 15/16 14/16 13/16 12/16 11/16 10/16 9/16 8/16 7/16 6/16 5/16 4/16 3/16 2/16 1/16 0/16 l l l l l l l l 15/16 13/16 11/16 9/16 7/16 5/16 3/16 1/16 h l h l h l h l 7/8 5/8 3/8 1/8 h l h l 3/4 1/4 h l 1/2 first 0 second third fourth subtract 1/16 if false compare voltage ( v dd )
m pd17072,17073 110 (2) flowchart of binary search start initial setting : select pin to be used. (a/d converter reference voltage setting register) = #1000b : set reference voltage to 1/2v dd adccmp = 1? y n reset adcrfsel3 flag : detect reference voltage and, : if "0", subtract 1/2v dd and, set adcrfsel2 flag : add both "0" and "1" to 1/4v dd and set reference voltage. adccmp = 1? : detect reference voltage and, reset adcrfsel2 flag : if "0", subtract 1/4v dd and, set adcrfsel1 flag : add both "0" and "1" to 1/8v dd and set reference voltage. adccmp = 1? : detect reference voltage and, y n y n reset adcrfsel1 flag : if "0", subtract 1/8v dd and, set adcrfsel0 flag : add both "0" and "1" to 1/16v dd and set reference voltage. adccmp = 1? : detect reference voltage and, reset adcrfsel0 flag : if "0", subtract 1/16v dd and, y n detect content of a/d converter reference voltage setting register end
m pd17072,17073 111 (3) program example of binary search start: bank1 initflg not adcch1, adcch0 ; selects ad0 pin initflg p1apld2 ; sets pull-down resistor of ad0 pin off initflg not adcrfsel3, adcrfsel2, adcrfsel1, adrfsel0 ; sets compare voltage to 7.5/16 v dd set1 adcstrt ; a/d converter starts operating. nop ; 2 wait nop ; skf1 adccmp ; detects adccmp set1 adcrfsel3 ; if 0, adds 7.5/16 v dd and clr1 adcrfsel2 ; subtracts 3.5/16 v dd set1 adcstrt ; a/d converter starts operating. nop ; 2 wait nop ; skf1 adccmp ; detects adccmp set1 adcrfsel2 ; if 0, adds 3.5/16 v dd and clr1 adcrfsel1 ; subtracts 1.5/16 v dd set1 adcstrt ; a/d converter starts operating. nop ; 2 wait nop ; skf1 adccmp ; detects adccmp set1 adcrfsel1 ; if 0, adds 1.5/16 v dd and clr1 adcrfsel0 ; subtracts 0.5/16 v dd set1 adcstrt ; a/d converter starts operating. nop ; 2 wait nop ; skf1 adccmp ; detects adccmp set1 adcrfsel0 ; if 0, adds 0.5/16 v dd end: 13.8 status at reset 13.8.1 at power-on reset the p1a2/ad0 and p1a3/ad1 pins are set in the general-purpose input port mode, and internally pulled down. 13.8.2 on execution of clock stop instruction the p1a2/ad0 and p1a3/ad1 pins are set in the general-purpose input port mode. the previous status of the pull-down resistor is retained. 13.8.3 at ce reset the p1a2/ad0 and p1a3/ad1 pins are set in the general-purpose input port mode. the previous status of the pull-down resistor is retained.
m pd17072,17073 112 14. serial interface 14.1 general figure 14-1 shows the outline of the serial interface. this serial interface is of two-wire/three-wire serial i/o type. the former type uses sck and so1/si pins. the latter uses sck, si, and so0 pins. figure 14-1. outline of serial interface remarks 1. siock1 and 0 (bits 0 and 1 of serial i/o clock select register. refer to figure 14-2 ) set a shift clock. 2. siots (bit 0 of serial i/o mode select register. refer to figure 14-3 ) starts/stops communication. 3. siohiz (bit 1 of serial i/o mode select register. refer to figure 14-3 ) sets the function of the so0/ p1c0 pin. 4. siosel (bit 3 of serial i/o mode select register. refer to figure 14-3 ) selects i/o of so1/si/p0b3 pin. data i/o control block so1/si/p0b3 so0/p1c0 presettable shift register (siosfr) out in siohiz flag siosel flag clock i/o control block sck/p0b2 siock1, 0 flags wait control block 75 khz siots flag clock counter clock control block irqsio flag wait signal count value 8
m pd17072,17073 113 14.2 clock input/output control block and data input/output control block the clock input/output control block and data input/output control block select the operation mode of the serial interface (2-wire or 3-wire mode), control the transmit/receive operation, and select a shift clock. the flags that control these blocks are allocated to the serial i/o clock select register and serial i/o mode select register. figure 14-2 shows the configuration and function of the serial i/o clock select register. figure 14-3 shows the configuration and function of the serial i/o mode select register. table 14-1 shows the setting status of each pin by the corresponding control flags. as shown in this table, the input/output setting flag of each pin must be also manipulated in addition to the control flag of the serial interface, to set each pin. the siock1 and 0 flags select the internal clock (master) or external clock (slave) operation. the siohiz flag selects whether the so0/p1c0 pin is used as a serial data output pin. the siosel flag selects whether the so1/si/p0b3 pin is used as a serial data input (si pin) or serial data output (so1) pin. figure 14-2. configuration of serial i/o clock select register 0 1 0 1 flag symbol b 3 0 b 2 0 b 1 s i o c k 1 b 0 s i o c k 0 name address (bank1) 61h read/ write r/w sets shift clock of serial interface external clock 12.5 khz 18.75 khz 37.5 khz 0 0 1 1 fixed to 0 power-on clock stop ce 0 0 0 0 0 0 0 0 serial i/o clock select register internal clock at reset
m pd17072,17073 114 figure 14-3. configuration of serial i/o mode select register flag symbol b 3 0 b 2 s i o s e l b 1 s i o h i z b 0 s i o t s name address (bank1) 60h read/ write r/w starts/stops serial communication stops (wait status) starts 0 1 sets function of p1c0/so0 pin general-purpose output port serial data output pin 0 1 selects function of p0b3/si/so1 pin as serial data input (si) pin as serial data output (so1) pin 0 1 fixed to 0 power-on clock stop ce 0 0 0 0 0 0 0 0 0 0 serial i/o mode select register at reset
m pd17072,17073 115 table 14-1. set status of each pin by control flags control flags of serial interface i/o setting flag of each pin communi- cation mode s i o s e l serial i/o select s i o h i z serial interface pin setting s i o c k 1 s i o c k 0 clock setting pin name p 0 b b i o 3 p 0 b b i o 2 set status of pin 3-wire serial i/o note 1 and 2-wire serial i/o note 2 0 0 external clock p0b2/sck 0 during wait: general-purpose input port wait released: external clock input 1 general-purpose output port 0 1 1 1 0 1 internal clock 0 1 general-purpose input port during wait: waits for internal clock output wait released: internal clock output 0 internal clock (reception) p0b3/si/ so1 during wait: general-purpose input port wait released: serial input general-purpose output port during wait: waits for serial output wait released: serial output 0 1 0 1 1 output (trans- mission) 0 general- purpose output p1c0/so0 general-purpose output port 1 serial output during wait: waits for serial output wait released: serial output notes 1. to set the 3-wire serial i/o mode, be sure to reset siosel to 0 and set siohiz to 1. 2. to use the 2-wire serial i/o mode, be sure to reset siohiz to 0.
m pd17072,17073 116 14.2.1 setting 2-/3-wire mode the serial interface uses two pins in the two-wire mode: sck/p0b2 and so1/si/p0b3. the sck/p0b2 pin is used as a shift clock input/output pin, and the so1/si/p0b3 pin is used as a serial data input/ output pin. the so0/p1c0 pin is not used for the serial interface and is set in the general-purpose output port mode by the siohiz flag. in this way, the serial interface operates in the two-wire mode. in the three-wire mode, three pins, sck/p0b2, so0/p1c0, and so1/si/p0b3 are used. the sck/p0b2 is used as a shift clock input/output pin, the so0/p1c0 pin is used as a serial data output pin, and the so1/si/p0b3 pin is used as a serial data input pin. unlike in the two-wire mode, the so0/p1c0 pin is used as a serial data output pin according to the setting of the siohiz flag. the so1/si/p0b3 pin is used as a serial data input pin according to the setting of the siosel flag. in this way, the serial interface operates in the three-wire mode. 14.2.2 selecting data input/output using 2-wire serial interface in the two-wire mode, the so1/si/p0b3 pin is used as an input/output pin for serial data. whether the so1/si/p0b3 pin is used as a serial data input pin (si pin) or serial data output pin (so1 pin) is specified by the siosel flag (refer to figure 14-3 configuration of serial i/o mode select register ). 14.3 clock control block the clock control block generates a clock when the internal clock is used (master operation), and controls clock output timing. the frequency f sc of the internal clock is set by the siock0 and siock1 flags of the serial i/o clock select register. figure 14-2 shows the configuration and function of the serial i/o clock select register. for the clock generation timing, refer to 14.7 operation of serial interface . 14.4 clock counter the clock counter counts the shift clock output or input from the shift clock pin (sck/p0b2 pin). because the clock counter directly reads the status of the clock pin, it cannot identify whether the clock is an internal clock or an external clock. the contents of the clock counter cannot be directly read by software. for the operation and timing chart of the clock counter, refer to 14.7 operation of serial interface .
m pd17072,17073 117 14.5 presettable shift register the presettable shift register is an 8-bit shift register that writes serial-out data and reads serial-in data. writing/reading data to/from the presettable shift register is performed by put and get instructions via data buffer. the presettable shift register outputs (transmits) the content of its most significant bit (msb) from the serial data i/o pin in synchronization with the falling edge of the shift clock, and reads data to its least significant bit (lsb) in synchronization with the rising edge of the shift clock. figure 14-4 shows the configuration and function of the presettable shift register. figure 14-4. configuration of presettable shift register note if the put or get instruction is executed during serial communication, the data may be lost. for details, refer to 14.8 notes on setting and reading data . 14.6 wait control block the wait control block performs wait (pause) control of communication. by releasing the wait status by using the siots flag of the serial i/o mode select register, serial communication is started. after the wait status has been released, and communication has been started, the wait status is resumed if shift clock rises at clock counter 8. the communication status can be detected by the siots flag. that is, the communication status can be detected by detecting the status of the siots flag after setting 1 to the siots flag. if 0 is written to the siots flag while the wait status is released, the wait status is set. this is called a forced wait status. for the configuration and function of the serial i/o mode select register, refer to figure 14-3 . setting of serial-out data and reading of serial-in data dbf3 data buffer name b 0 symbol peripheral register d7 d6 d5 d4 d3 d2 d1 m s b l s b b 1 b 2 b 3 b 4 b 5 b 6 b 7 presettable shift register valid data peripheral address siosfr 03h d7 d6 d5 d4 d3 d2 d1 d0 d0 serial out serial in 8 get note put note transfer data don't care dbf2 don't care dbf1 dbf0
m pd17072,17073 118 14.7 serial interface operation the timing of each operation of the serial interface is described below. this timing is applicable to both 2-wire and 3-wire modes. 14.7.1 timing chart figure 14-5 shows a timing chart. figure 14-5. timing chart of serial interface remarks <1> initial status (general-purpose input port) <2> start condition satisfied by general-purpose i/o port <3> wait released <4> wait timing <5> general-purpose input port mode set <6> stop condition satisfied by general-purpose i/o port 14.7.2 operation of clock counter the initial value of the clock counter is 0. the value of the clock counter is incremented each time the falling edge of the clock pin has been detected. when the value of the clock counter reaches 8, it is reset to 0 at the next rising edge of the clock pin. after the clock counter has been reset to 0, the serial communication is placed in the wait status. the conditions under which the clock counter is reset are as follows: (1) at power-on reset (2) when clock stop instruction is executed (3) when 0 is written to siots flag (4) if shift clock rises while wait status is released and present value of clock counter is 8 shift clock serial data clock counter siots <1> <2> <3> <4> <5> <6> int 1 23 78 1 d7 la d6 d5 d1 d0 d7 1 02 7 680 3
m pd17072,17073 119 14.7.3 wait operation and note when the wait status has been released, serial data is output at the next falling edge of the clock (transmission operation), and the wait released status continues until eight clocks are counted. after the eight clocks have been output, make the shift clock pin high and stop the operations of the clock counter and presettable shift register. note that, if data is written to or read from the presettable shift register while the wait status is released and the shift clock pin is high, the correct data is not set. if data is written to the presettable shift register while the wait status is released and the shift clock pin is low, the content of the msb of the data is output to the serial data output pin when the put instruction is executed. if the forced wait status is set while the wait status is released, the wait status is immediately set when 0 is written to the siots flag. 14.7.4 interrupt request issuance timing an interrupt request is issued when eight clocks have been transmitted (received). 14.7.5 shift clock generation timing (1) when wait status is released from initial status the initial status means the point at which the p0b2/sck pin has been made high with the internal clock operation selected. during the wait status, a high level is output to the shift clock pin. the wait status can be released and a clock can be selected at the same time.
m pd17072,17073 120 figure 14-6. shift clock generation timing of serial interface (1/4) (2) when wait operation is performed (a) when wait status is set at the 8th clock (normal operation) figure 14-6. shift clock generation timing of serial interface (2/4) 1/f sc shift clock wait status contents of output latch wait released wait wait released status 1/f sc wait released 13.33 s initialization wait status shift clock (37.5 khz) 1/f sc wait released 13.33 s initialization wait status shift clock (18.75 khz) 1 : 1 1/f sc wait released initialization wait status shift clock (12.5 khz) 2 : 1 26.66 s 1 : 1 m m m
m pd17072,17073 121 (b) when forced wait status is set during wait status figure 14-6. shift clock generation timing of serial interface (3/4) (c) when forced wait status is set while wait status is released figure 14-6. shift clock generation timing of serial interface (4/4) (d) when wait status is released while wait status is released the clock output waveform does not change. neither is the counter reset. however, do not change the clock frequency while the wait status is released. forced wait by siots contents of output latch contents of output latch wait period wait period shift clock 1/f sc shift clock wait status contents of output latch wait released forced wait by siots wait released status 1/f sc shift clock wait status contents of output latch wait released forced wait by siots wait released status
m pd17072,17073 122 14.8 notes on setting and reading data use the put siosfr, dbf instruction to set data to the presettable shift register. use the get dbf, siosfr instruction to read data. set or read the data in the wait status. while the wait status is released, the data may not be correctly set or read depending on the status of the shift clock pin. the following table describes the points to be noted in setting and reading data. table 14-2. data read and write operations of presettable shift register and notes status on execution status of shift clock pin operation of presettable shift register of put/get read (get) normal read normal write content of msb is output as data at falling edge of shift clock ? floating with external after wait status is released next (transmission operation). clock ? value of output latch write (put) with internal clock. normally, used with high level low level normal read read (get) high level cannot be read normally. contents of siosfr are lost. low level cannot be written normally. contents of siosfr are lost. normal write wait content of msb is output as data when put instruction is release executed. status clock counter is not reset. write (put) high level wait status clock msb data wait released put siosfr, dbf clock msb data put siosfr, dbf
m pd17072,17073 123 14.9 operational outline of serial interface tables 14-3 and 14-4 outline the operations of the serial interface. table 14-3. operation in 3-wire serial i/o mode operation mode slave operation (siock1 = siock0 = 0) master operation (siock1 = siock0 = other than 0) item during wait (siots = 0) wait released (siots = 1) during wait (siots = 0) wait released (siots = 1) status of sck/p0b2 ? when p0bbio2 = 0 ? when p0bbio2 = 0 ? when p0bbio2 = 0 ? when p0bbio2 = 0 each pin general-purpose input port external clock input port general-purpose input port general-purpose input port ? when p0bbio2 = 1 ? when p0bbio2 = 1 ? when p0bbio2 = 1 ? when p0bbio2 = 1 general-purpose output general-purpose output waits for internal clock internal clock output port port output si/so1/p0b3 siosel = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 general-purpose input port serial input general-purpose input port serial input ? when p0bbio3 = 1 ? when p0bbio3 = 1 ? when p0bbio3 = 1 ? when p0bbio3 = 1 general-purpose output general-purpose output general-purpose output general-purpose output port port port port so0/p1c0 siohiz = 1 waits for serial output serial output waits for serial output serial output program counter incremented at falling edge of sck pin operation of output ? when siohiz = 0 presettable not output shift register ? when siohiz = 1 shifted from msb and output from so0 pin at falling edge of sck pin input ? when siosel = 0 shifted from lsb and status of si pin is input at rising edge of sck pin. if si pin is set in output mode, however, contents of output latch are input. CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCC
m pd17072,17073 124 table 14-4. operation in two-wire serial i/o mode operation mode slave operation (siock1 = siock0 = 0) master operation (siock1 = siock0 = other than 0) item during wait (siots = 0) wait released (siots = 1) during wait (siots = 0) wait released (siots = 1) status of sck/p0b2 ? when p0bbio2 = 0 ? when p0bbio2 = 0 ? when p0bbio2 = 0 ? when p0bbio2 = 0 each pin general-purpose input port external clock input port general-purpose input port general-purpose input port ? when p0bbio2 = 1 ? when p0bbio2 = 1 ? when p0bbio2 = 1 ? when p0bbio2 = 1 general-purpose output general-purpose output waits for internal clock internal clock output port port output si/so1/p0b3 siosel = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 ? when p0bbio3 = 0 general-purpose input port serial input general-purpose input port serial input ? when p0bbio3 = 1 ? when p0bbio3 = 1 ? when p0bbio3 = 1 ? when p0bbio3 = 1 general-purpose output general-purpose output general-purpose output general-purpose output port port port port siosel = 0 waits for serial output serial output regardless of waits for serial output serial output regardless of regardless of p0bbio3 p0bbio3 regardless of p0bbio3 p0bbio3 so0/p1c0 siohiz = 1 general-purpose output port program counter incremented at falling edge of sck pin operation of output ? when siosel = 1 presettable shifted from msb and output from sio1 pin at falling edge of sck pin shift register input ? when siosel = 0 shifted from lsb and status of si pin is input at rising edge of sck pin. if si pin is set in output port mode, however, contents of output latch are input. CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCCC CCCC
m pd17072,17073 125 14.10 status on reset 14.10.1 at power-on reset p0b2/sck and p0b3/si/so1 pins are set in the general-purpose input port mode. p1c0/so0 pin is set in the general-purpose port. the contents of the presettable shift register are undefined. 14.10.2 at clock stop p0b2/sck and p0b3/si/so1 pins set in the general-purpose input port mode. p1c0/so0 pin is set in the general-purpose port. the previous contents of the presettable shift register are retained. 14.10.3 at ce reset p0b2/sck and p0b3/si/so1 pins are set in the general-purpose input port mode. p1c0/so0 pin is set in the general-purpose port. the previous contents of the presettable shift register are retained. 14.10.4 in halt status all the pins hold the current status. the internal clock stops output in the status in which the halt instruction is executed. when the external clock is used, the operation continued even if the halt instruction is executed.
m pd17072,17073 126 15. pll frequency synthesizer the pll (phase locked loop) frequency synthesizer is used to lock a frequency in the mf (medium frequency), hf (high frequency), and vhf (very high frequency) bands to a fixed frequency, by means of phase difference comparison. 15.1 general figure 15-1 outlines the pll frequency synthesizer. by connecting an external lowpass filter (lpf) and voltage controlled oscillator (vco), the pll frequency synthesizer can be configured. the pll frequency synthesizer divides a signal input from the vcoh or vcol pin by using a programmable divider, and outputs the phase difference between the signal and the reference frequency from the eo pin. however, the signal input from the vcoh pin is halved immediately before it is input to the programmable divider. the pll frequency synthesizer operates only while the ce pin is high. when the ce pin is low, the synthesizer is disabled. for details of the pll disable status, refer to 15.5 pll disable status . figure 15-1. outline of pll frequency synthesizer note external circuit remarks 1. pllmd1 and 0 (bits 1 and 0 of pll mode select register. refer to figure 15-3 ) set the division method of the pll frequency synthesizer. 2. pllrfck2, 1, and 0 (bits 2-0 of pll reference frequency select register. refer to figure 15-7 ) set the reference frequency f r of the pll frequency synthesizer. 3. pllul (bit 0 of pll unlock ff register. refer to figure 15-10 ) detects the status of the unlock ff. 75 khz input selector block programmable divider (pd) phase comparator ( -det) charge pump lowpass filter (lpf) voltage-controlled oscillator (vco) reference frequ- ency generator vcoh vcol f eo unlock ff pllul flag pllrfck2 flag pllrfck1 flag pllrfck0 flag pllmd1 flag pllmd0 flag note note
m pd17072,17073 127 15.2 input selector block and programmable divider 15.2.1 configuration and function of input selector block and programmable divider figure 15-2 shows the configuration of the input selector block and programmable divider. the input selector block selects the input pin and division method of the pll frequency synthesizer. as the input pin, the vcoh or vcol pin can be selected. the selected pin is at the intermediate potential (approx. 1/2v dd ). the pin not selected is internally pulled down. these pins have an ac amplifier at the input stage; therefore, cut the dc component of the input signal by connecting a capacitor in series. as the division method, dc division method or pulse swallow method can be selected. the programmable divider performs frequency division according to the values set to the swallow counter and programmable counter. table 15-1 shows each input pin (vcoh and vcol) and division method. the input pin and division method to be used are selected by the pll mode select register. figure 15-3 shows the configuration of the pll mode select register. a division value is set by using the pll data register. the division value is transferred to the programmable divider using pll data set register. figure 15-2. configuration of input selector block and programmable divider 5 pll disable signal vcol to f n -det pllmd1 flag pllmd0 flag vcoh 2 modular prescalers 1/32, 1/33 pll put flag swallower counter, 5 bits 12 12 bits 5 bits pll data register programmable counter, 12 bits f 1/2
m pd17072,17073 128 table 15-1. input pins and division modes division mode pin input frequency input amplitude division value division value set (mhz) (v p-p ) to data buffer direct division (mf) vcol 0.3 - 8 0.2 16 to 2 12 C 1 010xh - fffxh (x: dont care) pulse swallow vcol 5 - 130 0.3 1024 to 2 17 C 1 0400h C 1ffffh (hf) pulse swallow vcoh 40 - 230 0.2 1024 to 2 17 C 1 0400h C 1ffffh (vhf) figure 15-3. configuration of pll mode select register name flag symbol address read/ write (bank1) 65h r/w pll mode select register 0 1 0000 0 power-on clock stop ce sets division mode of pll frequency synthesizer pll disabled direct division (vcol pin mf mode) b 3 b 2 b 1 b 0 0 0 pulse swallow (vcoh pin vhf mode, 1/2 division) fixed to "0" 0 0 0 1 1 1 0 p l l m d 1 p l l m d 0 pulse swallow (vcol pin hf mode) retained at reset
m pd17072,17073 129 15.2.2 outline of each division mode (1) direct division mode (mf) in this mode, the vcol pin is used. the vcoh pin is floated. the frequency of the input signal is divided only by the programmable counter in this mode. (2) pulse swallow mode (hf) the vcol pin is used, and the vcoh pin is floated. in this mode, the frequency is divided by the swallow counter and programmable counter. (3) pulse swallow mode (vhf) the vcoh pin is used, and the vcol pin is floated. if this mode is selected 1/2 division is inserted in the stage previous to programmable divider. in this mode, the swallow counter and programmable counter are used for frequency division. (4) pll disable refer to 15.5 pll disable status .
m pd17072,17073 130 15.2.3 programmable divider, pll data register, and pll data set register a division value is set to the swallow counter and programmable counter by the pll data register. the value set by the pll data register is transferred by the pll data set register to the swallow counter and programmable counter. the swallow counter and programmable counter are 5-bit and 12-bit binary counters. the value to be divided is called an n value. for how to set the division value (n value) in each division mode, refer to 15.6 using pll frequency synthesizer . (1) configuration and functions of pll data register the configuration of the pll data register is shown in figure 15-4. the higher 12 bits of the 16-bit pll data register are valid in the direct division mode, and all the 17 bits of the register are valid in the pulse swallow mode. in the direct division mode, the 12 valid register bits are set to the programmable counter. in the pulse swallow mode, the higher 12 bits are set to the programmable counter, and the remaining lower 5 bits are set to the swallow counter. (2) configuration and function of pll data set register figure 15-5 shows the configuration of the pll data set register. by writing 1 to the pllput flag, the division value set by the pll data register is transferred to the swallow counter and programmable counter. after the data has been set, the pllput flag is reset to 0. (3) relations between value n of programmable divider and output frequency value n set to the pll data register and the frequency f n that is divided and output by the programmable divider are determined as follows. for details, refer to 15.6 use of pll frequency synthesizer . (a) in direct division mode (mf) f n = n: 12 bits (b) in pulse swallow mode (hf, vhf) f n = n: 17 bits note in vhf mode, frequency f in of the signal input from vcoh pin is divided by two immediately before input to the programmable divider. therefore, f n = in the vhf mode. f in n f in n 1 2 f in n
m pd17072,17073 131 figure 15-4. configuration of pll data register pll data register bank1 name address bit data 67h 68h 69h 6ah 6bh b 3 p l l r 1 7 b 2 p l l r 1 6 b 1 p l l r 1 5 b 0 p l l r 1 4 b 3 p l l r 1 3 b 2 p l l r 1 2 b 1 p l l r 1 1 b 0 p l l r 1 0 b 3 p l l r 9 b 2 p l l r 8 b 1 p l l r 7 b 0 p l l r 6 b 3 p l l r 5 b 2 p l l r 4 b 1 p l l r 3 b 0 p l l r 2 b 3 p l l r 1 b 2 0 b 1 0 b 0 0 fixed to 0 valid bit: 12 bits (direct division mode) sets division ratio of pll frequency synthesizer 0 | 15 (00fh) 16 (010h) | x | 2 12 e1 (fffh) don't care don't care setting prohibited division ratio n : n = x valid bit: 17 bits (in pulse swallow mode) sets division ratio of pll frequency synthesizer 0 | 1023 (03ffh) 1024 (0400h) | x | 2 17 e1 (1ffffh) setting prohibited division ratio n : n = x direct division mode pulse swallow mode remark on power application and at power-on reset, the contents of the pll data register are undefined. on execution of the clock stop instruction and at ce reset, the contents of the pll data register are retained.
m pd17072,17073 132 figure 15-5. configuration of pll data set register name flag symbol b 3 0 b 2 0 b 1 0 b 0 p l l p u t address (bank1) 6ch read/ write w data transfer to program counter does not transfer (data latch) transfers 0 1 fixed to 0 pll data set register power-on clock stop ce 0 0 0 0 0 0 at reset
m pd17072,17073 133 15.3 reference frequency generator figure 15-6 shows the configuration of the reference frequency generator. the reference frequency generator divides 75 khz output by the crystal oscillator to generate the reference frequency f r of the pll frequency synthesizer. as reference frequency f r , six frequencies can be selected: 1, 3, 5, 6.25, 12.5, and 25. reference frequency f r is selected by the pll reference frequency select register. figure 15-7 shows the configuration and functions of the pll reference frequency select register. figure 15-6. configuration of reference frequency generator 75 khz 1 khz 3 khz 5 khz 6.25 khz 12.5 khz 25 khz mux divider to -det pll disable signal pllrfck2 flag pllrfck1 flag pllrfck0 flag f off
m pd17072,17073 134 figure 15-7. configuration of pll reference frequency select register name flag symbol address read/ write (bank1) 66h r/w pll reference frequency select register 0 1 0000 0 power-on clock stop ce reset sets reference frequency f r of pll frequency synthesizer 1 khz 3 khz b 3 b 2 b 1 b 0 0 00 retained 0 0 0 1 1 1 5 khz 6.25 khz 0 0 0 0 p l l r f c k 2 p l l r f c k 1 p l l r f c k 0 0 0 1 1 0 1 0 1 1 1 1 1 12.5 khz 25 khz pll disable pll disable at reset remark when the pll reference frequency select register is set to pll disable status, the vcoh and vcol pins are floated. the eo pin is floated.
m pd17072,17073 135 15.4 phase comparator ( f -det), charge pump, and unlock ff 15.4.1 configurations of phase comparator, charge pump, and unlock ff figure 15-8 shows the configurations of the phase comparator, charge pump, and unlock ff. the phase comparator compares the output frequency of the programmable divider, f n , against the output frequency of the reference frequency generator, f r , and outputs up or dw request signal. the charge pump outputs the output signal of the phase comparator from the error out pin (eo). the unlock ff detects the unlock status of the pll frequency synthesizer. the following paragraphs 15.4.2 through 15.4.4 respectively describe the operations of the phase comparator, charge pump, and unlock ff. figure 15-8. configurations of phase comparator, charge pump, and unlock ff reference frequency generator f r programable divider f n unlock ff charge pump pllul flag up dw phase comparator ( -det) eo f pll disable signal
m pd17072,17073 136 15.4.2 functions of phase comparator as shown in figure 15-8, the phase comparator compares the output frequency of the programmable divider f n against reference frequency f r , and outputs up or down request signal. that is, if f n is lower than f r , it outputs the up request signal; if f n is higher than f r , the down request signal is output. figure 15-9 shows the relations among f r , f n , and up and down request signals. in the pll disable status, neither up nor down request signal is output. the up and down request signals are input to the charge pump and unlock ff. figure 15-9. relations among f r , f n , up, and dw f r f n up dw (a) if f n lags behind f r (b) if f n advances f r (c) if f n and f r are in phase (d) if f n is lower than f r f r f n up dw f r f n up dw f r f n up dw
m pd17072,17073 137 15.4.3 charge pump as shown in figure 15-8, the charge pump outputs the up and down request signals from the phase comparator to the error out pin (eo). therefore, the relations among the outputs of the error out pins, divided frequency f n , and reference frequency f r are as follows: when f r > f n : low-level output when f r < f n : high-level output when f r = f n : floating 15.4.4 unlock ff as shown in figure 15-8, the unlock ff detects the unlock status of the pll frequency synthesizer in response to the up or down request signal output from the phase comparator. in the unlock status, either one of the up or down request signals goes low. therefore, the unlock status can be detected when one of the request signals has gone low. in the unlock status, the unlock ff is set to 1. the status of the unlock ff is detected by the pll unlock ff register. figure 15-10 shows the configuration and function of the pll unlock ff register. the unlock ff is set at the cycle of the selected reference frequency f r . the unlock ff is reset when the contents of the pll unlock ff register is read by the instruction shown in table 15-2 (read & reset). therefore, the unlock ff must be detected at a cycle longer than the cycle of the reference frequency f r (which is 1/f r ). the delay of the up and down request signals of the phase comparator is fixed to about 1 m s. figure 15-10. configuration of pll unlock ff register remark u: undefined r: retained name flag symbol address read/ write pll unlock ff register (bank1) 6dh r & reset p l l u l 0 detects unlock ff status b 3 b 2 b 1 b 0 0 1 000 u r power-on clock stop ce unlock ff = 0: pll lock status fixed to "0" 00 r unlock ff = 1: pll unlock status at reset
m pd17072,17073 138 table 15-2. instructions to reset pll unlock ff register mnemonic operand mnemonic operand add m, #n4 add r, m addc addc sub sub subc subc and and or or xor xor ske ld skeg skt m, #n sklt skf skne mov @r, m m, @r note note when the row address of m is 6h and 0dh is written to r. remark m = 6dh
m pd17072,17073 139 15.5 pll disable status the pll frequency synthesizer stops its operation (i.e., is disabled) while the ce pin is low. similarly, the synthesizer stops when the pll disable status is selected by the pll reference frequency select register or pll mode select register even the ce pin is high. table 15-3 shows the operations of the respective blocks when the pll synthesizer is disabled. the pll reference frequency select register and pll mode select register are not initialized on ce reset, but retains their previous contents; therefore, the original status of the synthesizer is restored when the ce pin goes high after the ce pin has gone low and the pll disable status has been set. to set the pll disable status after the ce reset has been effected, initialization must be performed through program. the pll disable status is set on power-on reset. table 15-3. operations of respective blocks in pll disable status condition ce pin = low (pll disable) ce pin = high pll reference frequency pll mode select register block select register = 0110b, 0111b = 0000b vcol, vcoh pins floated programmable divider division stopped reference frequency generator output stopped phase comparator charge pump eo pin floated
m pd17072,17073 140 15.6 use of pll frequency synthesizer to control the pll frequency synthesizer, the following data are necessary: (1) division mode : direct division (mf) or pulse swallow (hf, vhf) (2) pin to be used : vcol or vcoh (3) reference frequency : f r (4) division value : n the following paragraphs 15.6.1 through 15.6.3 describe how to set the above data in each division mode (mf, hf, or vhf). 15.6.1 direct division mode (mf) (1) selecting division mode select the direct division mode by the pll mode select register. (2) pin to be used the vcol pin is enabled when the direct division mode is selected. (3) setting of reference frequency f r set the reference frequency by using the pll reference frequency select register. (4) calculating division value n calculate as follows: n = where, f vcol : input frequency of vcol pin f r : reference frequency (5) example of pll data setting suppose that broadcasting in the following mw band is to be received: receive frequency : 1422 khz (mw band) reference frequency : 3 khz intermediate frequency : +450 khz the division value n is: n = = = 624 (decimal) = 270h (hexadecimal) then set the pll data register, pll mode select register, and pll reference frequency select register as follows: f vcol f r f vcol f r 1422 + 450 3 pll data register pll mode select register pll reference frequency select register 0 0 0 1 0 0 0 1 mf 3 khz 0 0 1 0 2 0 1 1 1 7 0 0 0 0 0 dont care
m pd17072,17073 141 15.6.2 pulse swallow mode (hf) (1) selecting division mode select the pulse swallow mode by the pll mode select register. (2) pin to be used the vcol pin is enabled when the pulse swallow mode is selected. (3) setting reference frequency f r set the reference frequency by using the pll reference frequency select register. (4) calculating division value n calculate as follows: n = where, f vcol : input frequency of vcol pin f r : reference frequency (5) example of pll data setting suppose that broadcasting in the following sw band is to be received: receive frequency : 25.50 mhz (sw band) reference frequency : 5 khz intermediate frequency : +450 khz the division ratio n is: n = = = 5190 (decimal) = 1446h (hexadecimal) then set the pll data register, pll mode select register, and pll reference frequency select register as follows: f vcol f r f vcol f r 25500 + 450 5 pll data register pll mode select register pll reference frequency select register 0 0 1 1 0 0 1 0 hf 5 khz 0 0 0 0 1 1 0 1 0 4 0 0 1 0 4 0 0 1 1 6 0
m pd17072,17073 142 15.6.3 pulse swallow mode (vhf) (1) selecting division mode select the pulse swallow mode by the pll mode select register. (2) pin to be used the vcoh pin is enabled when the pulse swallow mode is selected. (3) setting of reference frequency f r set the reference frequency by using the pll reference frequency select register. (4) calculating division value n calculate as follows: n = where, f vcoh : input frequency of vcoh pin f r : reference frequency (5) example of pll data setting suppose that broadcasting in the following fm band is to be received: receive frequency : 100.0 mhz (fm band) reference frequency : 25 khz intermediate frequency : +10.7 mhz the division ratio n is: n = = = 2214 (decimal) = 08a6 (hexadecimal) then set the pll data register, pll mode select register, and pll reference frequency select register as follows: f vcoh f r 1 2 note f vcoh f r 1 2 note 100.0 + 10.7 0.025 1 2 note note the signal input from vcoh pin is divided by two immediately before input to the programmable divider. pll data register pll mode select register pll reference frequency select register 0 0 1 0 0 1 0 1 vhf 25 khz 0 0 0 0 0 0 1 0 0 8 0 1 0 1 a 0 0 1 1 6 0
m pd17072,17073 143 15.7 status on reset 15.7.1 on power-on reset the pll mode select register is initialized to 0000b; therefore, the pll disable status is set. 15.7.2 on clock stop the pll disable status is set when the ce pin goes low. 15.7.3 on ce reset (1) transition from clock stop to ce reset status the pll mode select register has been initialized to 0000b when the clock stop instruction has been executed; therefore, the pll disable status is set. (2) on ce reset the pll reference frequency select register retains the previous status; therefore, the previous status is restored when the ce pin goes high. 15.7.4 in halt status the set status is retained if the ce pin is high.
m pd17072,17073 144 16. intermediate frequency (if) counter 16.1 outline of intermediate frequency (if) counter figure 16-1 outlines the if counter. the if counter is mainly used to detect broadcasting stations, and is used to count the intermediate frequency (if) output from a tuner. the if counter counts the frequency input to the p0d3/fmifc/amifc or p0d2/amifc pin for a fixed time (1 ms, 4 ms, 8 ms, or open), by using a 16-bit counter. figure 16-1. outline of frequency counter ifcck1 flag ifcck0 flag p0d3/fmifc/amifc ifcstrt flag dbf gate time control block start control block if counter (16 bits) ifcg flag ifcres flag ifcmd0 flag ifcmd1 flag if counter input select block p0d2/amifc remarks 1. ifcmd1 and ifcmd0 (bits 3 and 2 of if counter mode select register. refer to figure 16-3 ) select the if counter function. 2. ifcck1 and ifcck0 (bits 1 and 0 of if counter mode select register. refer to figure 16-3 ) select the gate time of the if counter. 3. ifcstrt (bit 1 of if counter control register. refer to figure 16-5 ) controls starting of the if counter. 4. ifcg (bit 0 of if counter gate status detection register. refer to figure 16-6 ) detects opening/closing of the gate of the if counter. 5. ifcres (bit 0 of if counter control register. refer to figure 16-5 ) resets the count value of the if counter.
m pd17072,17073 145 16.2 if counter input select block and gate time control block figure 16-2 shows the configuration of the if counter input select block and gate time control block. the if counter input select block selects, by using the if counter mode select register, whether the p0d3/fmifc/ amifc and p0d2/amfic pin are used as if counter function pins or general-purpose i/o port pins. when using the if counter function, be sure to set the p0d3/fmifc/amifc and p0d2/amifc pins in the input mode. these pins can be set in the input or output mode by using the port 0c bit i/o select register at address 6fh of bank1 of ram. for the configuration and function of the port 0c bit i/o select register, refer to 10.2.3 (2) port 0c bit i/o select register . the gate time control block sets the gate time when the if counter function is used, by using the if counter mode select register. figure 16-3 shows the configuration and function of the if counter mode register. figure 16-2. configuration of if counter input select block and gate time control block p0d3/fmifc/amifc p0d2/amifc ifcmd1 flag ifcmd0 flag input port pin select gate signal generator ifcck1 flag ifcck0 flag operation mode select fmifc mode amifc mode 1/2 to start control block
m pd17072,17073 146 figure 16-3. configuration of if counter mode select register b 3 b 2 b 1 b 0 name address flag symbol read/ write if counter mode select register i f c m d 0 i f c m d 1 i f c c k 0 i f c c k 1 (bank1) 62h r/w 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 sets gate time of if counter 1 ms 4 ms 8 ms open selects function of if counter if counter off mode (general-purpose i/o port) fmifc/amifc pin: fmif count mode amifc pin: amif count mode fmifc/amifc pin: amif count mode power-on clock stop ce at reset
m pd17072,17073 147 16.3 start control block and if counter 16.3.1 configuration of start control block and if counter figure 16-4 shows the configuration of the start control block and if counter. the start control block starts counting of the frequency counter and detects the end of counting. the counter is started by the if counter control register. the end of counting is detected by the if counter gate status detection register. figure 16-5 shows the configuration and function of the if counter control register. figure 16-6 shows the configuration and function of the if counter gate status detection register. the 16.3.2, describe the gate operations when the if counter function is selected. the if counter is a 16-bit binary counter that counts up the input frequency when the if counter function is selected. when the if counter function is used, the if counter counts the frequency input to the pin while the gate is opened by an internal gate signal. although this frequency is counted as is in the amif count mode, it is halved and then counted in the fmif count mode. the if counter is cleared to 0000h when its count value has reached ffffh, and then continues counting. the count value is read via data buffer by the if counter data register (ifc). the count value is reset by the if counter control register. figure 16-7 shows the configuration and function of the if counter data register. figure 16-4. configuration of start control block and if counter from gate time selector block if counter data register (ifc) dbf 16 if counter (16 bits) 16 start control gate signal ifcstrt flag ifcg flag ifcres flag res
m pd17072,17073 148 figure 16-5. configuration of if counter control register name flag symbol address read/ write (bank1) 64h b 3 b 2 b 1 b 0 00 i f c s t r t i f c r e s w 0 1 0 1 0000 00 if counter control register nothing is changed resets counter controls count value of if counter nothing is changed starts counting fixed to "0" power-on clock stop ce at reset starts counting of if counter 00
m pd17072,17073 149 figure 16-6. configuration of if counter gate status detection register caution when the ifcg flag is set to 1 (the gate is open), do not read the contents of the if counter data register (ifc) to the data buffer. name flag symbol address read/ write 000 i f c gr (bank1) 63h if counter gate status detection register 0 detects opening/closing of if counter close fixed to "0" power-on clock stop ce 0000 b 3 b 2 b 1 b 0 0 0 1 at reset open
m pd17072,17073 150 16.3.2 gate operation of if counter function (1) when gate time is set to 1, 4, or 8 ms as shown below, the gate is opened for 1, 4, or 8 ms starting from the rising edge of an internal 1-khz signal after the ifcstrt flag has been set. while the gate is open, the frequency of a signal input to a specific pin is counted by a 16-bit counter. when the gate is closed, the ifcg flag is cleared (0). the ifcg flag is automatically set to 1 as soon as the ifcstrt flag has been set. (2) when gate time is open when the gate time is specified by the ifcck1 and ifcck0 flags to be open, the gate is immediately opened. if counting is started by the ifcstrt flag while the gate is open, the gate is closed after an undefined time. therefore, do not set the ifcstrt flag to 1 when the gate time is open. however, the counter can be reset by the ifcres flag. when the gate time is open, the gate can be opened and closed by resetting the gate time other than open by using ifcck1 and ifcck0 flags. open close gate count period sets ifcck1 = ifcck0 = 1 other than open is set by ifcck1 and ifcck0 flags h l open close internal 1 khz gate count period if ifcstrt flag is set during this period, gate is closed after undefined time sets ifcck1 = ifcck0 = 1 gate is actually opened at this point. if gate is opened with ifcg flag set to 1, it is closed after undefined time h l open close internal 1 khz 4 ms 1 ms 8 ms gate time count period (ifcg flag = 1) actual gate open at this point ifcstrt flag is set (ifcg flag is set by the instruction after ifcstrt flag is set) count ends ifcg flag is cleared
m pd17072,17073 151 figure 16-7. configuration of if counter data register data buffer name if counter data register transfer data 16 get can be executed nothing changes when put is executed peripheral register symbol peripheral address ifc 43h valid data dbf3 dbf2 dbf1 dbf0 b 15 b 14 b 13 b 12 b 11 b 10 b 9 b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 0 x 2 16 - 1 (ffffh) measured value of if counter ?fmif counter ?amif counter counts the rising edge of the signal input to the p0d2/amifc pin (in amif count mode) or p0d3/fmifc/amifc pin (in amif count mode). counts the rising edge of the signal input to the p0d3/fmifc/amifc pin (in fmif count mode) via a 1/2 divider.
m pd17072,17073 152 16.4 using if counter the following sections 16.4.1 through 16.4.3 describe how to use the hardware of the if counter, program example, and count error. 16.4.1 using hardware of if counter figure 16-8 shows the block diagram when the p0d2/amifc pin and p0d3/fmifc/amifc pins are used. table 16-1 shows the range of frequency that can be input to the p0d2/amifc pin and p0d3/fmifc/amifc pin. as shown in figure 16-8, the input pin of the if counter is provided with an ac amplifier; therefore, cut off the dc component of the input signal with a capacitor c. when the p0d2/amifc or p0d3/fmifc/amifc pin is selected for the if counter function, switch sw turns on and the voltage applied to the pin is about 1/2v dd . if the intermediate voltage does not rise sufficiently at this time, the ac amplifier is not in the normal operating range; consequently, the if counter does not function normally. therefore, provide a sufficient wait time after each pin has been specified to be used for the if counter function, until counting is started. when using the if counter function for the auto tuning function of a radio to detect broadcasting stations, it is recommended to use the function with the sd (station detection) output, and so on, of the tuner. figure 16-8. block diagram of if count function of each pin table 16-1. if counter input frequency range input pin input frequency input amplitude (mhz) (v p-p ) p0d3/fmifc/amifc 10 - 11 0.1 fmif mode p0d3/fmifc/amifc 0.4 - 2 0.15 amif mode 0.4 - 0.5 0.1 p0d2/amifc 0.4 - 2 0.15 amif mode 0.4 - 0.5 0.1 r sw external frequency fmifc amifc to internal counter c
m pd17072,17073 153 16.4.2 program example of if counter a program example of the if counter is shown below. as shown in this example, make sure that a wait time of a certain length elapses after an instruction that specifies the p0d2/amifc or p0d3/fmifc/amifc pin to be used for the if counter has been executed, until the counter is actually started. this is because the internal ac amplifier is not ready for normal operation immediately after the pin has been selected for the if counter function, as described in 16.4.1. example to count frequency of p0d3/fmifc/amifc pin (fmif count mode) (gate time: 8 ms) bank1 initflg ifcmd1, not ifcmd0, ifcck1, not ifcck0 ; selects fmifc pin (fmif count mode) and sets gate time to 8 ms wait ; internal ac amplifier stabilization time set1 ifcres ; resets if counter set1 ifcstrt ; starts if count loop: skt1 ifcg ; detects opening/closing of gate br read ; branches to read: if gate is closed processing a ; do not read data of if counter with this processing a. br loop read: get dbf, ifc ; reads value of if counter data register to data buffer 16.4.3 error of if counter the if counter has a gate time error and count error, as described in (1) and (2) below. (1) gate time error the gate time of the if counter is created by dividing the 75-khz system clock frequency. therefore, if this frequency has an error of +x ppm, the gate time accordingly has an error of -x ppm. (2) count error the if counter counts frequency at the rising edge of the input signal. therefore, if a high-level signal is input to the pin when the gate is opened, one extra pulse is counted. however, this extra pulse may not be counted, depending on the status of the pin, when the gate is closed. therefore, the count error is +1, -0.
m pd17072,17073 154 16.5 status at reset 16.5.1 power-on reset the p0d3/fmifc/amifc and p0d2/amifc pins are set in the general-purpose input port mode. the contents of the output latch are 0. 16.5.2 on execution of clock stop instruction the p0d3/fmifc/amifc and p0d2/amifc pins are set in the general-purpose input port mode. the contents of the output latch are retained. 16.5.3 at ce reset the p0d3/fmifc/amifc and p0d2/amifc pins are set in the general-purpose input port mode. the contents of the output latch are retained. 16.5.4 in halt status the p0d3/fmifc/amifc and p0d2/amifc pins retain the status immediately before the halt mode is set.
m pd17072,17073 155 17. beep 17.1 configuration and function of beep figure 17-1 outlines beep. beep outputs a clock of 1.5 khz or 3 khz from the beep pin. the output select block selects, by using the beep0ck0 and beep0ck1 flags of the beep clock select register, whether 1.5 khz or 3 khz is output from the beep pin, or whether the beep pin is used as a 1-bit general-purpose output port. the clock generation block generates the 1.5-khz or 3-khz clock to be output to the beep pin. figure 17-2 shows the configuration and function of the beep clock select register. figure 17-1. outline of beep figure 17-2. configuration and function of beep clock select register beep0ck0 flag beep0ck1 flag output select block 1.5 khz 3 khz output select block clock generation block beep 0 1 0 1 flag symbol b 3 0 b 2 0 b 1 b e e p 0 c k 1 b 0 b e e p 0 c k 0 name address (bank1) 5bh read/ write r/w setting of beep pin used as general-purpose output port and outputs low level used as general-purpose output port and outputs high level outputs 1.5 khz clock outputs 3 khz clock 0 0 1 1 fixed to 0 power-on clock stop ce 0 0 0 0 0 0 beep clock select register retained at reset
m pd17072,17073 156 17.2 output wave form of beep (1) output wave of f = 1.5 khz and f = 3 khz (3) minimum time until clock is output from beep pin after instruction execution example program to output 3-khz clock from beep pin bank1 ; same as mov bank, #0001b mov 5bh, #0011b ; writes 0011b to data memory address 5bh ; outputs 3 khz from beep pin (2) maximum time until clock is output from beep pin after instruction execution beep (f = 1.5 khz) 333.3 s 333.3 s beep (f = 3 khz) 133.3 s 200 s mm m m beep (f = 1.5 khz) 325.8 s instruction execution beep (f = 3 khz) 325.8 s instruction execution m m beep (f = 1.5 khz) beep (f = 3 khz) 133.3 s instruction execution 133.3 s instruction execution m m
m pd17072,17073 157 17.3 status at reset 17.3.1 at power-on reset the beep pin is set in the general-purpose output port mode, and outputs a low level. the value of the latch of the output port is 0. 17.3.2 on execution of clock stop instruction the beep pin is set in the general-purpose output port mode, and outputs a low level. the value of the latch of the output port is 0. 17.3.3 at ce reset the beep pin retains the previous output status. the contents of the latch are also retained. 17.3.4 in halt status the beep output pin retains the previous output status.
m pd17072,17073 158 18. lcd controller/driver the lcd (liquid crystal display) controller/driver can display an lcd of up to 60 dots by a combination of command signal and segment signal outputs. 18.1 outline of lcd controller/driver figure 18-1 outlines the lcd controller/driver. the lcd controller/driver can be used to display up to 60 dots by using a combination of common signal output pins (com0 through com3) and segment signal output pins (lcd0 through lcd14). the drive mode is 1/4 duty, 1/2 bias, the frame frequency is 62.5 hz, and drive voltage is v lcd1 . figure 18-1. outline of lcd controller/driver segment signal output timing control block common signal output timing control block lcd drive voltage generation block lcd segment register (data memory space) basic clock for timing control lcden flag lcd0 pin lcd14 pin com0 pin com3 pin reg lcd 0 pin reg lcd 1 pin cap lcd 0 pin cap lcd 1 pin remark lcden (bit 3 of lcd driver display start register: refer to figure 18-6 ) turns on/off all lcd display.
m pd17072,17073 159 18.2 lcd drive voltage generation block the lcd drive voltage generation block generates a voltage to drive the lcd. the m pd17073 supplies the lcd drive voltage from an external doubler circuit. to configure a doubler circuit, connect a capacitor to the reg lcd 0, cap lcd 0, cap lcd 1, and reg lcd 1 pins. figure 18-2 shows an example of configuration of the doubler circuit. to use a voltage of 3.1 v (typ.), connect as shown in figure 18-2. to operate the doubler circuit, the lcden flag of the lcd display start register must be set to 1. unless this flag is set to 1, the lcd drive voltage generation block does not operate. for the lcden flag, refer to 18.4 common signal output and segment signal output timing control blocks . figure 18-2. configuration of doubler circuit remark ( ): pin number note that, because of the configuration of the doubler circuit, the values of the lcd drive voltages (v lcd1 and v lcd0 ) differ if the values of c1, c2, and c3 are changed. reg lcd 1 cap lcd 1 cap lcd 0 reg lcd 0 c1 c2 c3 c1 = c2 = 0.1 f c3 = 0.01 f m m
m pd17072,17073 160 18.3 lcd segment register the lcd segment register sets dot data to turn on or turn off dots on the lcd. figure 18-3 shows the location in the data memory and configuration of the lcd segment register. because the lcd segment register is located in data memory, it can be controlled by all the data memory manipulation instructions. one nibble of the lcd segment register can set display data of 4 dots (data to turn dots on or off). if the lcd segment register is set to 1 at this time, the lcd display dot is on; the dot goes off if the register is set to 0. figure 18-4 shows the relation between the lcd segment register and lcd display dot. figure 18-3. location on data memory and configuration of lcd segment register column address 0123456789abcdef bank0 dbf 0 1 2 3 4 5 6 7 bank1 bcdef data memory system register lcd segment register 0 1 2 3 4 5 6 7 lcd segment register address symbol 41h lcdd14 42h lcdd13 43h lcdd12 44h lcdd11 45h lcdd10 46h lcdd9 47h lcdd8 48h lcdd7 49h lcdd6 4ah lcdd5 4bh lcdd4 4ch lcdd3 4dh lcdd2 4eh lcdd1 4fh lcdd0 b 3 b 2 b 1 b 0 lcdd14 row address
m pd17072,17073 161 figure 18-4. relation between lcd segment register and lcd display dot lcd segment register address symbol bit display dot 41h lcdd14 42h lcdd13 43h lcdd12 44h lcdd11 45h lcdd10 46h lcdd9 47h lcdd8 4eh lcdd1 4fh lcdd0 b 3 a b 2 b b 1 c b 0 d b 3 a b 2 b b 1 c b 0 d b 3 e b 2 f b 1 g b 0 h b 3 a b 2 b b 1 c b 0 d b 3 e b 2 f b 1 g b 0 h b 3 a b 2 b b 1 c b 0 d b 3 e b 2 f b 1 g b 0 h b 3 a b 2 b b 1 c b 0 d b 3 e b 2 f b 1 g b 0 h a b c d a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h lcd14 pin lcd13 pin lcd12 pin lcd11 pin lcd10 pin lcd9 pin lcd8 pin lcd1 pin lcd0 pin com3 pin com2 pin com1 pin com0 pin
m pd17072,17073 162 18.4 common signal output and segment signal output timing control blocks figure 18-5 shows the common signal output and segment signal output timing control blocks. the common signal output timing control block controls the common signal output timing of the com0 through com3 pins. the segment signal output timing control block controls the segment signal output timing of the lcd0 through lcd14 pins. the common and segment signals are output when the lcden flag of the lcd driver display start register is set to 1. when this flag is reset to 0, all the lcd display dots can be extinguished (refer to figure 18-6 ). when lcd display is not carried out, the com0 through com3 and lcd0 through lcd14 pins output low level. figure 18-5. configuration of common signal output and segment signal output timing control blocks segment signal common signal lcd0 | lcd14 com0 | com3 segment signal output timing control block basic clock for timing control common signal output timing control block lcden flag lcdd0 | lcdd14 b 0 b 1 b 2 b 3
m pd17072,17073 163 figure 18-6. configuration of lcd driver display start register cautions 1. bit 3 of the lcd display start register is a test mode area. therefore, do not write 1 to this bit. 2. for the function of the adcon flag, refer to 13.2 setting of a/d converter power supply. 18.5 common signal and segment signal output waves figure 18-7 shows an example of the common signal and segment signal output waves. the m pd17073 outputs a signal with a frame frequency of 62.5 hz using a 1/4 duty, 1/2 bias (voltage average method) drive mode. as the common signals, the com0 through com3 pins output three levels of voltages (gnd, v lcd0 , and v lcd1 ) each having a phase difference of 1/8 from the others. in other words, voltages of 1/2v dd are output with the v lcd0 as the reference. this display method is called the 1/2 bias drive method. as the segment signals, the segment signal output pins output voltages of two levels (gnd and v lcd1 ) having a phase corresponding to each display dot. because one segment pin can turn on or off four display dots (a, b, c, and d) as shown in figure 18-7, sixteen phases can be output by combining lighting and extinguishing of each dot. each display dot turnd on when the potential difference between a common signal and a segment signal is v lcd1 . in other words, the duty factor at which each display dot turns on is 1/4. this display method is called the 1/4 duty display method, and the frame frequency is 62.5 hz. name flag symbol b 3 0 b 2 0 b 1 a d c o n b 0 l c d e n address (bank1) 50h read/ write r/w sets on/off of all lcd displays display off (all segment and common output pins output low level) display on 0 1 fixed to 0 lcd driver display start register power-on clock stop ce 0 0 r 0 0 0 0 0 at reset remark r: retained
m pd17072,17073 164 figure 18-7. common signal and segment signal output waves com0 pin com1 pin com2 pin com3 pin a b c d each segment signal output pin (lcdn pin) common signal com0 pin com1 pin com2 pin com3 pin 4 ms v lcd1 v lcd0 gnd v lcd1 v lcd0 gnd v lcd1 v lcd0 gnd v lcd1 v lcd0 gnd v lcd1 gnd v lcd1 gnd v lcd1 gnd a, b, c, d = lights lcdn pin a, b, c = lights, d = extinguishes lcdn pin segment signal (example) 1 frame (16 ms) a, b, c, d = extinguishes lcdn pin
m pd17072,17073 165 18.6 using lcd controller/driver figure 18-8 shows an example of wiring of an lcd panel an example of a program that lights the 7 segments connected to lcd0 and lcd1 pins shown in figure 18-8 is given below. example pmn0 mem 0.01h ; preset number storage area ch flg lcdd0.3 ; defines symbol with high-order 1 bit of lcd0 register for ch display lcddata: ; lcd segment table data dw 0000000000000000b ; blank dw 0000000000000110b ; 1 dw 0000000010110101b ; 2 dw 0000000010100111b ; 3 dw 0000000001100110b ; 4 dw 0000000011100011b ; 5 dw 0000000011110011b ; 6 dw 0000000010000110b ; 7 dw 0000000011110111b ; 8 dw 0000000011100111b ; 9 mov ar0, #.dl.lcddata shr 12 and 0fh mov ar1, #.dl.lcddata shr 8 and 0fh mov ar2, #.dl.lcddata shr 4 and 0fh mov ar3, #.dl.lcddata and 0fh ld dbf0, ar0 ld dbf1, ar1 ld dbf2, ar2 ld dbf3, ar3 add dbf0, pmn0 addc dbf1, #0 addc dbf2, #0 addc dbf3, #0 st ar0, dbf0 st ar1, dbf1 st ar2, dbf2 st ar3, dbf3 movt dbf, @ar ; table reference instruction bank1 st lcdd0, dbf0 st lcdd1, dbf1 set1 ch set1 lcden ; lcd on
m pd17072,17073 166 figure 18-8. example of wiring of lcd panel 1 b 1 f 1 c 1 e 1a 1g 1d 2 b 2 f 2 c 2 e 2a 2g 2d 3 b 3 f 3 c 3 e 3a 3g 3d 4 b 4 f 4 c 4 e 4a 4g 4d 5a 5 b 5 f 5 c 5 e 5g 5d fm mw sw lw abcd e f g am pm mhz khz ch lcd0 lcd1 lcd2 lcd3 lcd4 lcd5 lcd6 lcd7 lcd8 lcd9 lcd10 lcd11 lcd12 lcd13 lcd14 com0 com1 com2 com3 segment pin common l c d 14 l c d 13 l c d 12 l c d 11 l c d 10 l c d 9 l c d 8 l c d 7 l c d 6 l c d 5 l c d 4 l c d 3 l c d 2 l c d 1 l c d 0 com3 com2 com1 com0 fm mw sw lw b a 1a 1f 1g 1e 1b 1c 1d 2a 2f 2g 2e 2b 2c 2d 3a 3f 3g 3e c 3b 3c 3d 4a 4f 4g 4e d 4b 4c 4d e f g am pm mhz khz 5a 5f 5g 5e ch 5b 5c 5d correspondence of segment and common pins, and lcd panel display ?
m pd17072,17073 167 18.7 status at reset 18.7.1 at power-on reset the lcd0 through lcd14 pins output a low level. the com0 through com3 pins also output a low level. therefore, the lcd display is off. the contents of the lcd segment register are undefined. 18.7.2 on execution of clock stop instruction the lcd0 through lcd14 pins output a low level. the com0 through com3 pins also output a low level. therefore, the lcd display is off. the lcd segment register retains the previous contents. 18.7.3 at ce reset the lcd0 through lcd14 pins output segment signals. the com0 through com3 pins output common signals. the lcd segment register retains the previous contents. 18.7.4 in halt status the lcd0 through lcd14 pins output segment signals. the com0 through com3 pins output common signals. the lcd segment register retains the previous contents.
m pd17072,17073 168 19. standby the standby function is used for the purpose of reducing the current consumption of the device when the device is in the backup status. 19.1 general figure 19-1 shows the outline of the standby block.the standby function is to reduce the current consumption of the device by stopping part of or entire device, or slowing down the cpu clock. the standby function can be used in the following four modes, which can be selected according to the application: <1> halt mode <2> clock stop mode <3> controlling device operation by ce pin <4> low-speed function the halt mode is to reduce the current consumption of the device by stopping the operation of the cpu when a dedicated instruction, halt h, has been executed. the clock stop mode is to reduce the current consumption of the device by stopping the oscillation of the oscillator circuit when a dedicated instruction, stop s, has been executed. the ce pin is usually used to control the operation of the pll frequency synthesizer and to reset the device. however, it can be said to be a mode of the standby function in that this pin controls operations. the low-speed function is to reduce the current consumption of the device by slowing down the cpu clock.
m pd17072,17073 169 figure 19-1. outline of standby block remark ce flag (bit 0 of ce pin status detection register. refer to figure 19-6 ) detects the status of the ce pin. p1a3/ad1 p1a2/ad0 p1a1 p1a0 internal block program counter instruction decoder system register peripheral control register ce x out x in ce flag input latch cpu alu clock stop block halt block interrupt control block basic timer 0 clock stop control circuit stop s halt control circuit halt h
m pd17072,17073 170 19.2 halt function 19.2.1 general the halt function is to stop the operation clock of the cpu by executing the halt h instruction. when this instruction has been executed, the program is stopped and is not executed unless the halt status is released. therefore, the current consumption of the device is reduced by the operating current of the cpu in the halt status. the halt status is released by key input, basic timer 0, or interrupt. the releasing condition is specified by the operand h of the halt h instruction. the halt h instruction is valid regardless of the input level of the ce pin. 19.2.2 halt status in the halt status, all the operations of the cpu are stopped. in other words, the program execution is stopped by the halt h instruction. however, the peripheral hardware retains the status set before the halt h instruction is executed. for the operation of each peripheral hardware, refer to 19.4 device operations in halt and clock stop statuses . 19.2.3 halt release condition figure 19-2 shows the halt release conditions. the halt release condition is set by 4-bit data that is specified by the operand h of the halt h instruction. the halt status is released when the condition specified as 1 in operand h is satisfied. when the halt status has been released, program execution is started from the instruction next to "halt h" instruction. if two or more release conditions are specified, the halt status is released if any one of the specified conditions has been satisfied. when the device has been reset (by means of power-on reset or ce reset), the halt status is released, and the appropriate reset operation is performed. if 0000b is set as the halt release condition h, no release condition is set. in this case, the halt status is released when the device is reset (power-on reset or ce reset). figure 19-2. halt release condition operand b 1 b 2 b 3 b 0 releases if high level is input to port 1a releases if basic timer 0 carry ff is set (1) undefined (fix this bit to "0".) releases when interrupt request flag and interrupt enable flag are set (when executing ei and di instructions) halt h (4 bits) 0: does not release halt status even if condition is satisfied 1: releases halt status if condition is satisfied sets halt status release condition
m pd17072,17073 171 19.2.4 releasing halt by key input to release the halt mode by key input, the halt instruction is specified as halt 0001b. with the key input specified as the halt release condition, the halt mode is released when a high-level signal is input to any one of the p1a0, p1a1, p1a2/ad0, and p1a3/ad1 pin. however, halt mode cannot be released by a pin disconnected to the pull-down resistor. (1) when using general-purpose output port as key source signal to use a general-purpose output port as the key source signal, make the output port high-level, and execute the halt 0001b instruction. when an alternate switch is used at this time as switch a in the above figure, a high-level is always input to the p1a0 pin while switch a is closed, and the halt mode is immediately released. therefore, care must be exercised when key input is specified as the halt mode releasing condition and an alternate switch is used. (2) to release halt by other microcontroller p1a3/ad1 latch switch a p1a2/ad0 p1a1 p1a0 general-purpose output port the p1a0, p1a1, p1a2/ad0, and p1a3/ad1 pins can also be used as general-purpose input ports with pull- down resistor. therefore, other microcontrollers can also be used as shown above after the halt mode has been released. p1a3/ad1 latch p1a2/ad0 p1a1 p1a0 general-purpose output port output port microcontroller, etc.
m pd17072,17073 172 19.2.5 releasing halt status with basic timer 0 to release the halt condition by using the basic timer 0, use the halt 0010b instruction. when it has been set that the halt status is to be released by the basic timer 0, the basic timer 0 carry ff is set to 1, and at the same time, the halt status is released. the basic timer 0 carry ff corresponds to the btm0cy flag on a one-to-one basis and is set at fixed time intervals (125 ms). therefore, the halt status can be released at specific time intervals. example to release halt status every 125 ms and perform processing a every 1 second m1 mem 0.10h ; 1-second counter hlttmr dat 0010b ; symbol definition loop: halt hlttmr ; specifies that halt status is released by basic timer 0 carry ff, and sets halt status bank1 skt1 btm0cy ; embedded macro br loop ; branches to loop if btm0cy flag is not set bank0 add m1, #0010b ; adds 0010b to contents of m1 skt1 cy ; embedded macro br loop ; executes processing a if carry occurs processing a br loop
m pd17072,17073 173 19.2.6 releasing halt status by interrupt to release the halt status by interrupt, use the halt 1000b instruction. there are three interrupt sources available as explained in 11. interrupt. therefore, the interrupt by which the halt status is to be released must be specified by software. the halt status is released if the following conditions (1) through (3) are satisfied: (1) the halt 1000b instruction is set. (2) each interrupt is enabled by the corresponding interrupt enable flag (ip flag = 1). (3) an interrupt request is issued by the corresponding interrupt request flag (irq flag = 1). depending on whether the ei or di instruction is executed at this time, the operation to be performed after the halt status has been released differs. if the ei instruction is executed, the program branches to the vector address of the interrupt. if the reti instruction is executed after the interrupt has been serviced, the program returns to the next instruction after the halt instruction. if the di instruction is executed, the program does not branch to a vector address, but the next instruction next after the halt instruction is executed as soon as the halt status has been released. examples of programs when the ei and di instruction are executed, and notes on releasing the halt status by interrupt are described below.
m pd17072,17073 174 example 1. example of program when ei instruction is executed hltint dat 1000b ; symbol definition for halt mode inttm dat 0002h ; defines symbol of interrupt vector address intpin dat 0003h ; defines symbol of interrupt vector address start: br main ; program address 0000h org inttm ; basic timer 1 interrupt vector address br inttimer org intpin ; interrupt service by int pin processing a br ei_reti inttimer: ; interrupt service by basic timer 1 processing b ei_reti: ei reti main: bank1 set2 ipbtm, ip ; embedded macro set1 btm1ck ; sets time interval of basic timer 1 to 8 ms loop: processing c ; main routine processing ei ; enables all interrupts halt hltint ; sets releasing halt mode by interrupt ; <1> br loop in this example, the halt mode is released when an interrupt by basic timer 1 has been accepted, processing b is executed, and processing a is executed when an interrupt by int pin has been accepted. each time the halt mode is released, processing c is executed. if the interrupt request by int pin and interrupt request by basic timer 1 are issued exactly at the same time in the halt mode, processing a of int pin, which is assigned the higher hardware priority, is executed. when reti is executed after execution of processing a, the execution is returned to the br loop instruction in <1> . however, the br loop instruction is not executed, but the basic timer 1 interrupt is accepted immediately, and processing b is executed. if the reti instruction is executed after processing b, the br loop instruction is executed.
m pd17072,17073 175 example 2. example of program when di instruction is executed hltint dat 1000b ; symbol definition of halt condition start: di ; disables all interrupts bank1 set2 ipbtm1, ip ; embedded macro set1 btm1ck ; sets time of interrupt by basic timer 1 to 8 ms loop: halt hltint ; sets releasing halt status by interrupt skt1 irq ; detects halt release trigger br intbtm1 clr1 irq ; processing a ; interrupt service by int pin intbtm1: skt1 irqbtm1 ; detects halt release trigger br loop clr1 irqbtm1 ; processing b ; interrupt service by basic timer 1 br loop because the di instruction is executed in the above example, the program does not branch to the respective vector addresses but executes the next instruction even if interrupt by basic timer 1 or int pin is accepted.
m pd17072,17073 176 caution when executing the halt instruction that is released when an interrupt request flag (irq ), for which the corresponding interrupt enable flag (ip ) is set, is set, describe a nop instruction immediately before the halt instruction. when the nop instruction is described immediately before the halt instruction, time of one instruction is generated between the irq manipulation instruction and halt instruction. in the case of the clr1 irq instruction, for example, clearing irq correctly is reflected upon the halt instruction (example 1 below). if the nop instruction is not described immediately before the halt instruction, the crl1 irq instruction is not correctly reflected on the halt instruction, and the halt mode is not set (example 2). examples 1. to execute halt instruction correctly ; sets irq clr1 irq nop ; nop instruction is described immediately before halt instruction ; (clearing irq is correctly reflected on halt instruction) halt 1000b ; halt instruction is executed correctly (halt mode is set) 2. program that does not set halt mode ; sets irq clr1 irq ; clearing irq is not reflected on halt instruction ; (it is reflected on instruction next to halt instruction) halt 1000b ; halt instruction is ignored (halt mode is not set) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
m pd17072,17073 177 19.2.7 when two or more release conditions are specified when two or more halt release conditions are specified, the halt mode is released if any one of the specified conditions is satisfied. the following example shows how the condition is identified when two or more conditions are specified: example hltint dat 1000b hlttmr dat 0010b hltkey dat 0001b intpin dat 0003h ; vector address symbol definition of int pin interrupt start: br main org intpin processing a ; int pin interrupt service ei reti tmrup: ; basic timer 0 processing processing b ret keydec: ; key input processing processing c ret main: bank1 mov p1b, #1111b ; outputs p1b3-p1b0 at high level as key source output set1 ip ; embedded macro ; enables int pin interrupt ei loop: halt hltint or hlttmr or hltkey ; specifies external interrupt (int pin), basic timer 0, ; and key input as halt release condition skt1 btm0cy ; embedded macro ; detects btm0cy flag br key_dec call tmrup ; basic timer 0 processing if set to 1 br loop keydec: key processing br loop
m pd17072,17073 178 19.3 clock stop function the clock stop function stops the 75 khz crystal resonator when the stop s instruction (clock stop status) is executed. therefore, the current dissipation of the device is reduced to 3 m a maximum (t a = 25 c, v dd = 3.0 v). as the operand s of the stop s instruction, 0000b is specified. the stop s instruction is valid only when the ce pin is at the low level, and is executed as a no-operation (nop) instruction when the ce is at the high level. therefore, the stop s instruction must be executed when the ce pin is at the low level. the clock stop mode can be released by ce reset rising the ce pin, or by power-on reset with supply voltage v dd application. 19.3.1 clock stop status in the clock stop status, the crystal resonator is stopped. as a result, the cpu and all the peripheral hardware stop their operations. for the operations of the cpu and peripheral hardware, refer to 19.4 device operations in halt and clock stop statuses . 19.3.2 releasing clock stop status the clock stop status can be released in the following two ways. after the clock stop status has been released, the program is started from address 0000h, regardless of which of (1) and (2) has been used to release the clock stop status. (1) raise the ce pin from low to high (ce reset). (2) lower the supply voltage v dd of the device to 1.8 v or less note , and then raise it again to 1.8 v or higher (t a = C20 to +70 c, normal operation) (power-on reset). note this voltage is called power-on clear voltage. the maximum value of the power-on clear voltage is 1.8 v, and the actual value is in a range not exceeding this maximum value. for details, refer to 20.4.1 power-on clear voltage . 19.3.3 releasing clock stop status by ce reset figure 19-3 illustrates how the clock stop status is released by the ce reset.
m pd17072,17073 179 figure 19-3. releasing clock stop by ce reset 3 v 0 v h l h l v dd ce pin x out pin 3 v 0 v h l h l v dd ce pin x out pin 125 ms or more stop s instruction program starts from address 0 (ce reset) if the clock stop instruction is not used, the operation is performed as follows: program starts from address 0 (ce reset) 0 -t set ce reset is effected in synchronization with next setting of basic timer 0 carry ff after ce pin goes high note this voltage is called power-on clear voltage. the maximum value of the power-on clear voltage is 1.8 v, and the actual value is in a range not exceeding this maximum value. for details, refer to 20.4.1 power- on clear voltage . 19.3.4 releasing clock stop status by power-on reset figure 19-4 illustrates how the clock stop status is released by power-on reset. when the clock stop status is released by power-on reset, the power failure detection circuit operates. figure 19-4. releasing clock stop by power-on reset 3 v 0 v h l h l v dd ce pin x out pin 3 v 0 v h l h l v dd ce pin x out pin 1.8 v note 125 ms or more stop s instruction program starts from address 0 (power-on reset) if the clock stop instruction is not used, the operation is performed as follows: 125 ms or more oscillation stops program starts from address 0 (power-on reset) 1.8 v note
m pd17072,17073 180 19.3.5 notes on using clock stop instruction the clock stop instruction (stop s) is valid only when the ce pin is at the low level. therefore, it is necessary to design program taking into consideration the chance that the stop s instruction is to be executed when the ce pin happens to be at the high level. here is an example: example xtal dat 0000b ; symbol definition of clock stop condition cejdg: ; <1> skf1 ce ; embedded macro ; detects input level of ce pin br main ; branches to main processing ; if ce = high level processing a ; processing when ce = low ; <2> stop xtal ; clock stops ; <3> br $-1 main: main processing br cejdg in this program example, the status of the ce pin is detected in <1>. if it is at the low level, the clock stop instruction stop xtal in <2> is executed after processing a has been performed. however, if the ce pin goes high while the stop xtal instruction is executed as shown below, the instruction is treated as a no-operation (nop) instruction. at this time, assuming that the branch instruction br $-1 in <3> is missing, the program execution enters the main processing, and malfunctioning may take place. therefore, either insert the branch instruction as shown in <3>, or the program must be designed so that malfunctioning does not take place even after the execution enters the main processing. if the ce pin is at high level when the stop xtal instruction is executed, ce reset is effected when the basic timer 0 carry ff is set next time. 3 v 0 v h l v dd ce pin main processing processing a ce pin is detected <1> <1> <1> <2> stop xtal treated as "nop" because ce pin is high program starts from address 0 in synchronization with setting of basic timer 0 carry ff (ce reset)
m pd17072,17073 181 19.4 device operations in halt and clock stop statuses table 19-1 shows the operations of the cpu and peripheral hardware in the halt and clock stop statuses. in the halt status, all the peripheral hardware continue the normal operation, except that instruction execution is stopped. in the clock stop status, all peripheral hardware stop. the peripheral control register that controls the operating status of the peripheral hardware operates normally (not initialized) in the halt status, but is initialized to a specified value in the clock stop status (when the stop s instructio n is executed). each peripheral hardware continues the operation set in the peripheral control register in the halt status, and its operation status is determined by the initialized value of the peripheral control register in the clock stop status. for the value to which the peripheral control register is to be initialized, refer to chapter table 8-1. peripheral hardware functions of peripheral control register . here is an example: example when p1c0/so0 pin of port 1c is specified as output port pin, and p0b3/si/so1 pin and p0b2/sck pins are used for serial interface hltint dat 1000b xtal dat 0000b initflg p0bbio3,p0bbio2 ;<1> set3 p0b3, p0b2 ;<2> bank1 clr1 irqsio initflg siock1, siock0 initflg siosel, not siohiz set1 ipsio ei ;<3> set1 siots ;<4> halt hltint ;<5> stop xtal in the above example, the p0b3, p0b2 pins output high level in <1> , the condition of serial interface is set in <2> , and serial communication is started in <3> . when the halt instruction is executed in <4> , the halt status is set, but the serial communication continues, and the halt status is released when the interrupt by the serial interface is accepted. if the stop instruction in <5> is executed instead of the halt instruction in <4> , the contents of all the peripheral control registers set in <1> , <2> , and <3> are initialized. consequently, serial communication is stopped, and all the pins of the port 0b are set in the general-purpose input port mode.
m pd17072,17073 182 table 19-1. device operations in halt and clock stop statuses status hardware peripheral ce pin = high level ce pin = low level in halt status in clock stop status in halt status in clock stop status program counter system register peripheral register timer pll frequency synthe- sizer a/d converter beep serial interface frequency counter lcd controller/driver general-purpose i/o port general-purpose input port general-purpose output port stops at address before halt instruction retained retained normal operation normal operation normal operation normal operation normal operation normal operation normal operation normal operation normal operation normal operation stop instruction is invalid (nop) stops at address before halt instruction retained retained normal operation disabled normal operation normal operation normal operation normal operation normal operation normal operation normal operation normal operation initialized to 0000h and stops initialized note retained stops stops stops stops stops stops stops input port input port retained note for the value to which these registers are initialized, refer to 4. data memory (ram), 5. system register (sysreg) and 8. peripheral control register . 19.5 note on processing of each pin in halt and clock stop statuses the halt status is used to reduce the current consumption of the device when, for example, only the watch is to be operated. the clock stop status is used to reduce the current consumption of the device to retain only the contents of the data memory. therefore, the current consumption must be minimized in the halt and clock stop status. the current consumption may increase depending on the status of each pin and therefore, the points listed in table 19-2 must be observed.
m pd17072,17073 183 port 0b port 0c port 0d port 1a port 0a port 1b port 1c interrupt ce reset all pins are specified as general-purpose input port pins. at this time, all input ports except port 1a (p1a3/ad1, p1a2/ad0, p1a1, p1a0) do not increase current consumption by noise, even if they are floated. port 1a (p1a3/ad1, p1a2/ad0, p1a1, p1a0) is retained the status before clock stop. (1) when pull-down resistor on is selected by program: current consumption increases if these pins externally pulled up. (2) when pull-down resistor off is selected by program: these pins are floated and current consumption by noise increases. these ports are specified as general- purpose output ports. the output contents are retained as is. therefore, current consumption increases if these ports are externally pulled down while they output high level, or pulled up while they output low level. p0b3/si/so1 p0b2/sck p0b1 p0b0 p0c1 p0c0 p0d3/fmifc/amifc p0d2/amifc p1a3/ad1 p1a2/ad0 p1a1 p1a0 p0a3 | p0a0 p1b3 | p1b0 p1c0/so0 int ce table 19-2. pin status in halt and clock stop statuses and notes (1/2) pin status and note on processing pin function pin symbol halt status clock stop status hold status immediately before halt status. (1) when specified as output pins current consumption increases if any of these pins is externally pulled down while it outputs high level, or exter- nally pulled up when it outputs low level. (2) when specified as input pins (except p1a3/ad1, p1a2/ad0, p1a1, p1a0) current consumption by noise does not increase if any of these pins is floated. (3) port 1a (p1a3/ad1, p1a2/ad0, p1a1, p1a0) current consumption increases if these pins externally pulled up when they selected pull-down resistors on by program. when pull-down resistor off is selected, these pins are floated and current consumption by noise increases. (4) p0d3/fmifc/amifc, p0d2/amifc when p0d3/fmifc/amifc, p0d2/ amifc pins are used for frequency counter, current consumption in- creases because internal amplifier operates. initialize frequency counter by pro- gram as necessary because it is not automatically disabled even when ce pin is low. current consumption increases by external noise if this pin is floated. current consumption increases by external noise if this pin is floated. general- purpose i/o port general- purpose input port general- purpose output port
m pd17072,17073 184 when these pins are used as general-purpose output port pins, the same points as those of the general-purpose output port described above must be observed. current consumption increases when pll operates. when pll is disabled, vcol, vcoh : floated eo : floated when ce pin goes low, pll is automatically disabled. current consumption changes with waveform oscillated by crystal oscillator circuit. the greater the oscillation amplitude, the lower the current consumption. oscillation amplitude is varied depending on crystal resonator and load capacitor, and therefore must be evaluated. table 19-2. pin status in halt and clock stop statuses and notes (2/2) pin status and note on processing halt status clock stop status pin function pin symbol all pins are specified as lcd segment signal output pins and output low levels (display off). pll is disabled. each pin is as follows: vcol, vcoh : floated eo : floated x in pin is internally pulled down and x out pin outputs high level lcd14 | lcd0 vcol vcoh eo x in x out lcd segment pll frequency synthesizer crystal oscillator circuit
m pd17072,17073 185 19.6 device control function by ce pin the ce pin has the following functions by using the input level and rising edge of a signal input from an external source: (1) pll frequency synthesizer (2) making clock stop instruction valid or invalid (3) resets device 19.6.1 controlling operation of pll frequency synthesizer the pll frequency synthesizer can operate only when the ce pin is high. when the ce pin is low, pll is automatically disabled. when pll is disabled, the vcoh and vcol pins are floated, and the eo pin is also floated. the pll frequency synthesizer can also be disabled through program even when the ce pin is high. 19.6.2 making clock stop instruction valid or invalid the clock stop instruction (stop s) is valid only when the ce pin is low. the clock stop instruction executed when the ce pin is high is treated as an nop (no operation) instruction. 19.6.3 resetting device the device can be reset by raising the ce pin (ce reset). the device can also be reset by turning off supply voltage v dd (power-on reset). for details, refer to 20. reset .
m pd17072,17073 186 19.6.4 inputting signal to ce pin the ce pin does not accept a low- or high-level signal less than 200 m s in order to protect the system from malfunctioning due to noise. the level of the signal input to the ce pin can be detected by using the ce flag of the ce pin status detection. figure 19-5 shows the relations between the input signal and ce flag. figure 19-5. relations between signal input to ce pin and ce flag 19.6.5 configuration and functions of ce pin status detection register the ce pin status detection register detects the level of the signal input to the ce pin. the configuration and functions of this register are illustrated below. figure 19-6. configuration of ce pin status detection register name flag symbol address read/ write ce pin status detection register (bank1) 52h r c e 0 detects status of ce pin b 3 b 2 b 1 b 0 0 1 000 _ _ _ power-on clock stop ce low level high level fixed to "0" 00 at reset remark C: determined by status of pin the ce flag does not change even if a low or high level signal less than 200 m s is input. h l 1 0 ce pin ce flag less than 200 s m 200 s m ce reset pll enabled stop s invalid (nop) pll disabled stop s valid pll disabled stop s invalid (nop) ce reset is effected in synchronization with next setting of basic timer 0 carry ff less than 200 s m 200 s m
m pd17072,17073 187 19.7 low-speed mode function the m pd17073 can slow down the cpu clock when 1 is written to the sysck flag of the system clock select register. this function is called a low-speed mode function. the time required to execute one instruction in the low-speed mode is 106.6 m s. however, the instruction that is executed immediately after the sysck flag has been set to 1 takes 103.3 m s. by slowing down the cpu clock, the current consumption of the device can be lowered as compared with that during normal operation. figure 19-7 shows the configuration and function of the system clock select register. figure 19-7. configuration of system clock select register 19.7.1 releasing low-speed mode the low-speed mode is released when the sysck flag is reset to 0 by power-on reset, or when 0 is written to the sysck flag. after the low-speed mode has been released, the cpu clock returns to the normal operation speed (one instruction execution time: 53.3 m s). however, the instruction that is executed immediately after the sysck flag has been reset to 0 takes 56.6 m s. name flag symbol b 3 0 b 2 0 b 1 0 b 0 s y s c k address (bank1) 55h read/ write r/w selects system clock (one instruction execution time) 53.3 s 106.6 s 0 1 fixed to 0 system clock select register power-on clock stop ce 0 r r 0 0 0 remark r: retained m m at reset
m pd17072,17073 188 20. reset the reset function is to initialize the device operation. 20.1 configuration of reset block figure 20-1 shows the configuration of the reset block. the device can be reset in two ways: by means of power-on reset (or v dd reset) that is effected by applying supply voltage v dd , and ce reset that is effected by using the ce pin. the power-on reset block consists of a voltage detector circuit that detects the voltage input to the v dd pin, a power failure detector circuit, and a reset control circuit. the ce reset block consists of a circuit that detects the rising of the signal input to the ce pin, and a reset control circuit. figure 20-1. configuration of reset block x out x in divider btm0cy flag read r s q basic timer 0 carry disable ff power-on clear signal (poc) reset control circuit reset signal ires res reset stop s instruction voltage detector circuit rising detector circuit stop instruction forced halt by basic timer 0 carry peripheral control register, system register, stack, program counter v dd ce power failure detector block timer ff block basic timer 0 carry
m pd17072,17073 189 20.2 reset function the power-on reset is effected when supply voltage v dd has risen from a specific level, and the ce reset is effected when the ce pin goes high from low. the power-on reset is to initialize the program counter, stack, system register, basic timer 0 carry ff and control register, and execute the program from address 0000h. the ce reset is to initialize part of the program counter, stack, system register, and peripheral control register, and execute the program from address 0000h. the main differences between the power-on reset and ce reset are the contents of the peripheral control register to be initialized, and the operation of the power failure detector circuit, which is to be described in 20.6. the power-on reset and ce reset are controlled by the reset signals ires, res, and reset that are output from the reset control circuit shown in figure 20-1. table 20-1 shows the relations among the ires, res, and reset signals, power-on reset, and ce reset. the reset control circuit also operates when the clock stop instruction (stop s) described in 19. standby has been executed. the following 20.3 and 20.4 respectively describe the ce reset and power-on reset. 20.5 describes the relations between the ce reset and power-on reset. table 20-1. relations between internal reset signal and each reset output signal internal reset signal at ce reset at power- at clock stop contents controlled by each reset signal on reset ires forcibly sets device in halt status, which is released by setting basic timer 0 carry ff. res initializes part of peripheral control register reset initializes part of program counter, stack, system register, and peripheral control register.
m pd17072,17073 190 20.3 ce reset the ce reset is effected by making the ce pin high. when the ce pin goes high, the reset signal is output in synchronization with the rising edge of the next basic timer 0 carry ff setting pulse, and the device is reset. when the ce reset has been effected, part of the program counter, stack, system register, and peripheral control register is initialized to an initial value by the reset signal, and the program is executed from address 0000h. for the initial value, refer to the description of each register.the operation of the ce reset differs depending on whether the clock stop mode is used or not. this is described in 20.3.1 and 20.3.2. 20.3.3 describes the points to be noted when effecting the ce reset. 20.3.1 ce reset when clock stop mode (stop s instruction) is not used figure 20-2 shows the operation. when the clock stop mode (stop s instruction) is not used, and after the ce pin has gone high, therefore, the reset signal is output at the rising edge of the basic timer 0 carry ff setting pulse selected at that time (t set = 125 ms), and reset is effected. figure 20-2. ce reset operation when clock stop mode is not used basic timer 0 carry ff setting pulse ires res reset normal operation v dd ce x out 5 v 0 v h l normal operation ce reset is effected at rising edge of basic timer 0 carry ff setting pulse. if basic timer 0 carry ff setting time t set = 125 ms, 0 < t < 125 ms during this period because of the rising timing of the ce pin. during this period, the program continues operation. reset signals h l h l h l h l h l
m pd17072,17073 191 20.3.2 ce reset when clock stop mode (stop s instruction) is used figure 22-3 shows the operation. when the clock stop mode is used, the ires, res, and reset signals are output at the point where the stop s instruction has been executed. while the ce pin is low, output of the ires signal continues; therefore, the forced halt status, which is released by the basic timer 0 carry, is set. however, the device stops operation because the clock is stopped. when the ce pin goes high, the clock stop mode is released and oscillation is started. at this time, the halt status that is released by the basic timer 0 carry ff is set by the ires signal. after the ce pin has risen, the oscillation stabilization status lasts (for 125 ms or longer). if the basic timer 0 carry ff setting pulse rises after that, the halt status is released, and program execution is started from address 0. figure 20-3. ce reset operation when clock stop mode is used 20.3.3 notes on ce reset because ce reset is effected regardless of the instruction under execution, the following points (1) and (2) must be noted. (1) time for executing timer processing such as watch to create a watch program by using the basic timer 0 or basic timer 1, the processing of the program must be completed within specific time. for details, refer to 12.2.5 notes on using basic timer 0 and 12.3.4 notes on using basic timer 1 . (2) processing of data or flag used in program exercise care in rewriting data or flags that cannot be processed with one instruction and whose contents must not be changed even if ce reset is effected, such as security code. here is an example: basic timer 0 carry ff setting pulse ires res reset halt status 125 ms or more v dd ce x out 3 v 0 v h l normal operation ce reset program starts from address 0. reset signals clock stop status stop 0000b instruction clock stop released. oscillation starts. h l h l h l h l h l
m pd17072,17073 192 example 1. r1 mem 0.01h ; 1st digit of input data of security code r2 mem 0.02h ; 2nd digit of input data of security code r3 mem 0.03h ; data of 1st digit when security code is changed r4 mem 0.04h ; data of 2nd digit when security code is changed m1 mem 0.11h ; 1st digit of current security code m2 mem 0.12h ; 2nd digit of current security code start: key input processing ; waits for key input of r1 ? key a contents ; security code r2 ? key b contents ; substitutes contents of pressed code into r1 and r2 set2 cmp, z ; <1> ; compares security code with input data sub r1, m1 sub r2, m2 skt1 z br error ; input data is different from security code main: key input processing ; security code rewriting mode r3 ? key c contents ; substitutes contents of r4 ? key d contents ; pressed key into r3 and r4 st m1, r3 ; <2> ; rewrites security code st m2, r4 ; <3> br main error: does not operate suppose the security code is 12h in this example. then the contents of the data memory addresses m1 and m2 are 1h and 2h, respectively. when the ce reset is effected at this time, the contents of the key input in <1> are compared with the security code 12h, and if they are the same, the ordinary processing is performed. when the security code is changed by the main processing, the new code is rewritten to m1 and m2 in <2> and <3>. suppose the security code is changed to 34h. then 3h and 4h are written to m1 and m2 in <2> and <3>. however, if the ce reset happens to occur when <2> has been executed, the program is started from address 0000h without <3> executed. consequently, the security code is changed to 32h, which is not intended, and security cannot be released. in this case, use the program shown in example 2.
m pd17072,17073 193 example 2. r1 mem 0.01h ; 1st digit of input data of security code r2 mem 0.02h ; 2nd digit of input data of security code r3 mem 0.03h ; data of 1st digit when security code is changed r4 mem 0.04h ; data of 2nd digit when security code is changed m1 mem 0.11h ; 1st digit of current security code m2 mem 0.12h ; 2nd digit of current security code change flg 0.13h.0 ; 1 while security code is changed start: key input processing ; waits for key input of r1 ? key a contents ; security code r2 ? key b contents ; substitutes contents of pressed code into r1 and r2 skt1 change ; <4> ; if change flag is 1, br security_chk st m1, r3 ; rewrites m1 and m2 st m2, r4 clr1 change security_chk: set2 cmp, z ; <1> ; compares security code with input data sub r1, m1 sub r2, m2 skt1 z br error ; input data is different from security code main: key input processing ; security code rewriting mode r3 ? key c contents ; substitutes contents of r4 ? key d contents ; pressed key into r3 and r4 set1 change ; <5> ; set change to 1 while security code is rewritten st m1, r3 ; <2> ; rewrites security code st m2, r4 ; <3> clr1 change ; sets change flag to 0 after security code is rewritten br main error: does not operate in this example, the change flag is set to 1 in <5> before the security code is rewritten in <2> and <3>. therefore, the security code is written again in <4> even if the ce reset is effected in <3>.
m pd17072,17073 194 20.4 power-on reset power-on reset is effected by raising the supply voltage v dd of the device from a specific level (called power-on clear voltage). power-on clear voltage is described in 20.4.1. if the supply voltage v dd is lower than the power-on clear voltage, a power-on clear signal (poc) is detected from the voltage detector circuit shown in figure 20-1. when the power-on clear signal is output, the crystal oscillator circuit is stopped, and the device stops operation. while the power-on clear signal is output, the ires, res, and reset signals are output. when the supply voltage v dd exceeds the power-on clear voltage, the power-on clear signal is turned off, the crystal oscillator starts, and the ires, res, and reset signals are also turned off. at this time, the halt status that is released by the basic timer 0 carry ff is set by the ires signal. after the power- on clear signal is deasserted, the oscillation stabilization status lasts (for 125 ms or longer). if the basic timer 0 carry ff setting pulse rises after that, the halt status is released, and power-on reset is effected. this operation is illustrated in figure 20-4. at power-on reset, the program counter, stack, system register, and peripheral control register are initialized as soon as the power-on clear signal has been output. for the power-on reset while the cpu is operating, refer to 20.4.2 . for the power-on reset in the clock stop status, refer to 20.4.3 . for the power-on reset when supply voltage v dd rises from 0 v, refer to 20.4.4 . figure 20-4. operation of power-on reset basic timer 0 carry ff setting pulse ires res reset halt status 125 ms or more v dd ce x out 3 v 0 v h l normal operation power-on reset program starts from address 0. reset signals device operation stops power-on clear released. oscillation starts. power-on clear signal power-on clear voltage h l h l h l h l h l h l
m pd17072,17073 195 20.4.1 power-on clear voltage the power-on clear voltage differs as follows, depending on the cpu operating temperature range and operating conditions: t a = 0 to +70 c : 1.6 v max. (when cpu is operating and pll frequency synthesizer and a/d converter stop) t a = C10 to +70 c : 1.7 v max. (when cpu is operating and pll frequency synthesizer and a/d converter stop) t a = C20 to +70 c : 1.8 v max. (when cpu, pll frequency synthesizer, and a/d converter are operating) the above values are the maximum values, and the actual power-on clear voltage must be in a range that does not exceed these maximum values. the power-on clear voltage during the cpu operation is the same as that in the clock stop status. in the description below, the power-on clear voltage is assumed to be 1.8 v. 20.4.2 power-on reset during normal operation figure 20-5 (a) shows the operation. as shown in this figure, the power-on clear signal is output regardless of the input level of the ce pin when the supply voltage v dd drops below 1.8 v (t a = C20 to +70 c, when cpu, pll, a/d are operating), and the device operation is stopped. when the supply voltage v dd rises beyond 1.8 v again, the program starts from address 0000h after a halt status of 125 ms or more. the cpu operation includes when the clock stop instruction is not used, and power-on clear voltage is 1.8 v during halt status set by the halt instruction. 20.4.3 power-on reset in clock stop mode figure 20-5 (b) shows the operation. as shown in this figure, the power-on clear signal is output and the device operation is stopped when the supply voltage v dd drops below 1.7 v (t a = C20 to +70 c, when cpu, pll, a/d are operating). however, because the clock stop mode is set, the operation of the device seems not to be changed. when the supply voltage v dd rises beyond 1.8 v, the program starts from address 0000h after a halt of 125 ms or more. 20.4.4 power-on reset when supply voltage v dd rises from 0 v figure 20-5 (c) shows the operation. as shown in this figure, the power-on clear signal is output until the supply voltage v dd rises from 0 v to 1.8 v (t a = C20 to +70 c, cpu, pll, a/d are operating). when the supply voltage v dd exceeds the power-on clear voltage, the crystal oscillator circuit starts operating, and the program starts from address 0000h after a halt of 125 ms or more.
m pd17072,17073 196 figure 20-5. power-on reset and supply voltage v dd (t a = e20 to +70 c, when cpu, pll, a/d are operating) (a) during cpu operation (including halt status) (b) in clock stop mode halt status 125 ms or more v dd ce x out 3 v 0 v h l normal operation power-on reset program starts from address 0. device operation stops power-on clear released. oscillation starts. power-on clear signal power-on clear voltage 1.8 v h l h l halt status 125 ms or more power-on reset program starts from address 0. device operation stops power-on clear released. oscillation starts. v dd ce x out 3 v 0 v h l power-on clear signal 1.8 v power-on clear voltage h l h l halt status 125 ms or more v dd ce x out 3 v 0 v h l h l normal operation power-on reset program starts from address 0. device operation stops power-on clear released. oscillation starts. power-on clear signal power-on clear voltage l h 1.7 v clock stop stop s instruction 1.8 v (c) when supply voltage v dd rises from 0 v
m pd17072,17073 197 20.5 relations between ce reset and power-on reset there is a possibility that power-on reset and ce reset are effected simultaneously when the supply voltage v dd is applied for the first time. the reset operations at this time are described in 20.5.1 through 20.5.3. 20.5.1 when v dd pin and ce pin rises simultaneously figure 20-6 (a) shows the operation. at this time, the program starts from address 0000h because of power-on reset. 20.5.2 when ce pin rises during forced halt status of power-on reset figure 20-6 (b) shows the operation. at this time, the program starts from address 0000h because of power-on reset, in the same manner as 20.5.1 above. 20.5.3 when ce pin rises after power-on reset figure 20-6 (c) shows the operation. at this time, the program starts from address 0000h because of power-on reset, and the program starts from address 0000h again at the rising edge of the next basic timer 0 carry ff setting signal because of ce reset.
m pd17072,17073 198 figure 20-6. relations between power-on reset and ce reset (t a = e20 to +70 c, when cpu, pll, a/d are operating) (a) when vdd and ce pins rises simultaneously halt status 125 ms or more power-on reset program starts. v dd ce 3 v 0 v h l 1.8 v power-on clear voltage normal operation basic timer 0 carry ff setting pulse operation stops h l halt status 125 ms or more power-on reset program starts. v dd ce 3 v 0 v h l 1.8 v power-on clear voltage normal operation basic timer 0 carry ff setting pulse ce reset program starts. h l operation stops (b) when ce pin rises in halt status halt status 125 ms or more power-on reset program starts. v dd ce 3 v 0 v h l 1.8 v power-on clear voltage normal operation basic timer 0 carry ff setting pulse h l operation stops (c) when ce pin rises after power-on reset
m pd17072,17073 199 20.6 power failure detection the power failure detection feature is used to judge, when the device has been reset, whether the reset has been effected by application of supply voltage v dd or by the ce pin. because the contents of the data memory and output ports are undefined on power application, the contents of these are initialized by detecting a power failure. the power failure can be detected by detecting the btm0cy flag by using a power failure detector circuit. figure 20-7. power failure detection flowchart 20.6.1 power failure detector circuit the power failure detector circuit consists of a voltage detector circuit as shown in figure 20-1, basic timer 0 carry disable flip-flop that is reset by the output (power-on clear signal) of the voltage detector circuit, and basic timer 0 carry. the basic timer 0 carry disable ff is set to 1 by the power-on clear signal, and reset to 0 when an instruction that reads the btm0cy flag has been executed. while the basic timer 0 carry disable ff is set to 1, the btm0cy flag is not set to 1. if the power-on clear signal is output (at power-on reset), therefore, the program is started with the btm0cy flag cleared, and setting of the btm0cy flag is inhibited until an instruction that reads the btm0cy flag is executed later. once the instruction that reads the btm0cy flag has been executed, the btm0cy flag is set each time the basic timer 0 carry ff setting pulse rises. therefore, whether power-on reset (power failure) or ce reset (not power failure) has been effected can be judged by checking the content of the btm0cy flag, when the device has been reset. that is, if the btm0cy flag is cleared to 0, power-on reset has been effected; if the flag is set to 1, ce reset has been effected. the voltage at which a power failure can be detected is the same voltage at which power-on reset is effected. figure 20-8 illustrates the status transition of the btm0cy flag. figure 20-9 shows the timing chart of figure 20-8 and the operation of the btm0cy flag. program starts power failure detected not power failure power failure initializes data memory and output ports
m pd17072,17073 200 figure 20-8. status transition of btm0cy flag note 1.8 v is the maximum value and the actual power-on clear voltage is in a range that does not exceed this maximum value. for details, refer to 20.4.1 power-on clear voltage . clock stop normal operation. ce reset wait normal operation ce reset normal operation btm0cy = 1 <15> rising of basic timer 0 carry ff setting pulse <14> stop 0 <13> <12> clock stop normal operation. ce reset wait normal operation ce reset crystal oscillation starts. forced halt (125 ms or more) normal operation btm0cy = 0 <7> rising of basic timer 0 carry ff setting pulse <6> stop 0 <5> <4> power-on reset crystal oscillation starts. forced halt (125 ms or more) v dd = low operation stops skt1 btm0cy or skf1 btm0cy skt1 btm0cy or skf1 btm0cy ce = h ? l ce = l ? h ce = l ? h ce = h ? l ce = l ? h ce = l ? h ce = low ce = don't care ce = high <1> <2> <3> v dd = l ? 1.8 v note ce = l ce = h setting btm0cy flag inhibited <16> <17> setting btm0cy flag enabled <8> <9> <10> <11> crystal oscillation starts. forced halt (125 ms or more)
m pd17072,17073 201 figure 20-9. operation of btm0cy flag (a) when btm0cy flag is never detected (skt1 btm0cy or skf1 btm0cy is not executed) timer time changed v dd ce btm0cy 3 v 0 v operation in figure 20-8 btm0cy flag setting pulse h l h l h l <1> <2> <6> <3> <5> <8> <7> <6> <5> stop 0000 b <4> <9> <6> <1> <7> (b) to detect power failure with btm0cy flag timer time changed v dd ce btm0cy skti instruction 3 v 0 v operation in figure 20-8 btm0cy flag setting pulse h l h l h l <1> <2> <6> <14> <3> <11> btm0cy = 0 power failure <13> <16> <15> btm0cy = 1 not power failure <14> <13> stop 0000 b <12> <17> <14> <1> btm0cy = 1 not power failure <15>
m pd17072,17073 202 20.6.2 notes on power failure detection with btm0cy flag keep in mind the following points when using the btm0cy flag for watch counting: (1) updating watch when creating a watch program by using the basic timer 0, it is necessary to update the watch after a power failure has been detected. this is because watch counting is skipped once because the btm0cy flag is read when a power failure has been detected, and thus the btm0cy flag is cleared to 0. (2) watch updating processing time to update the watch, its processing must be completed before the next basic timer 0 carry ff setting pule rises. this is because ce reset is effected without the watch updating processing completed if the ce pin goes high while the watch updating processing is in progress. for further information on (1) and (2) above, refer to 12.2.5 (3) adjusting basic timer 0 at ce reset . to perform power failure processing, the following points must be noted. (3) power failure detection timing watch counting with the btm0cy flag must be completed before the next basic timer 0 carry ff setting pulse rises after the btm0cy flag for power failure detection has been read and the program has been started from address 0000h. this is because, the basic timer 0 carry ff setting time is 125 ms, and if power failure detection is performed 126 ms after the program has been started, the btm0cy flag is not detected once. for details, refer to 12.2.5 (3) adjusting basic timer 0 at ce reset . moreover, power failure detection and initial processing must be completed within the basic timer 0 carry ff setting time, as shown in the example on the next page. this is because, if he ce pin rises and ce reset is effected during power failure detection or initial processing, the processing is interrupted, resulting in troubles. to change the basic timer 0 carry ff setting time in the initial processing, one instruction must be used to change the setting time at the end of the initial processing.
m pd17072,17073 203 example program example start: ; program address 0000h ;<1> processing at reset ;<2> bank1 skt1 btm0cy ; power failure detection br initial backup: ;<3> watch updating br main initial: ;<4> initial processing main: main processing skt1 btm0cy br main watch updating br main operation example < 1 > < 4 > v dd 3 v 0 v ce h l btm0cy flag setting pulse h l < 1 > < 3 > ce reset ce reset 125 ms < 2 > power failure detection < 2 > power failure detection if total processing time of < 1 > + < 4 > is 125 ms or longer, ce reset is effected in the middle of processing. if total processing time of < 1 > + < 3 > is too long, ce reset is effected. 125 ms
m pd17072,17073 204 21. m pd17012 instructions 21.1 instruction set outline b 15 b 14 Cb 11 01 bin. hex. 00000add r, m add m, #n4 00011sub r, m sub m, #n4 00102 addc r, m addc m, #n4 00113 subc r, m subc m, #n4 01004and r, m and m, #n4 01015xor r, m xor m, #n4 01106or r, m or m, #n4 inc ar movt dbf, @ar br @ar call @ar ret retsk ei di 01117 reti push ar pop ar get dbf, p put p, dbf rorc r stop s halt h nop 10008ld r, m st m, r 10019ske m, #n4 skge m, #n4 1010amov @r, m mov m, @r 1011b skne m, #n4 sklt m, #n4 1100cbr addr (page 0) call addr (page 0) 1101dbr addr (page 1) mov m, #n4 1110e skt m, #n 1111f skf m, #n
m pd17072,17073 205 21.2 legend ar : address register asr : address stack register indicated by stack pointer addr : program memory address (lower 11 bits) bank : bank register cmp : compare flag cy : carry flag dbf : data buffer h : halt release condition intef : interrupt enable flag intr : register automatically saved to stack when interrupt occurs intsk : interrupt stack register mp : data memory row address pointer mpe : memory pointer enable flag m : data memory address indicated by m r , m c m r : data memory row address (higher) m c : data memory column address (lower) n : bit position (4 bits) n4 : immediate data (4 bits) page : page (bits 11 of program counter) pc : program counter p : peripheral address p h : peripheral address (higher 3 bits) p l : peripheral address (lower 4 bits) r : general register column address sp : stack pointer s : stop release condition ( ) : contents address by
m pd17072,17073 206 21.3 instruction list instruction instruction code mnemonic operand operation group op code operand r, m (r) ? (r) + (m) 00000 m r m c r add m, #n4 (m) ? (m) + n4 10000 m r m c n4 addition r, m (r) ? (r) + (m) + cy 00010 m r m c r addc m, #n4 (m) ? (m) + n4 + cy 10010 m r m c n4 inc ar ar ? ar + 1 00111 000 1001 0000 r, m (r) ? (r) C (m) 00001 m r m c r sub m, #n4 (m) ? (m) C n4 10001 m r m c n4 subtraction r, m (r) ? (r) C (m) C cy 00011 m r m c r subc m, #n4 (m) ? (m) C n4 C cy 10011 m r m c n4 r, m (r) ? (r) v (m) 00110 m r m c r or m, #n4 (m) ? (m) v n4 10110 m r m c n4 logical r, m (r) ? (r) (m) 00100 m r m c r and operation m, #n4 (m) ? (m) n4 10100 m r m c n4 r, m (r) ? (r) v (m) 00101 m r m c r xor m, #n4 (m) ? (m) v n4 10101 m r m c n4 skt m, #n cmp ? 0, if (m) n = n, then skip 11110 m r m c n judgment skf m, #n cmp ? 0, if (m) n = 0, then skip 11111 m r m c n ske m, #n4 (m) Cn4, skip if zero 01001 m r m c n4 skne m, #n4 (m) Cn4, skip if not zero 01011 m r m c n4 compare skge m, #n4 (m) Cn4, skip if not borrow 11001 m r m c n4 sklt m, #n4 (m) Cn4, skip if borrow 11011 m r m c n4 cy ? (r) b3 ? (r) b2 ? (r) b1 ? (r) b0 rotate rorc r 00111 000 0111 r ld r, m (r) ? (m) 01000 m r m c r st m, r (m) ? (r) 11000 m r m c r if mpe = 1: (mp, (r)) ? (m) @r, m 01010 m r m c r if mpe = 0: (bank, m r , (r)) ? (m) transfer if mpe = 1: (m) ? (mp, (r)) mov m, @r 11010 m r m c r if mpe = 0: (m) ? (bank, m r , (r)) m, #n4 (m) ? n4 11101 m r m c n4 movt dbf, @ar sp ? sp C1, asr ? pc, pc ? ar, 00111 000 0001 0000 dbf ? pc, pc ? asr, sp ? sp + 1 v v v v
m pd17072,17073 207 instruction instruction code mnemonic operand operation group op code operand push ar sp ? sp C 1, asr ? ar 00111 000 1101 0000 pop ar ar ? asr, sp ? sp + 1 00111 000 1100 0000 transfer get dbf, p dbf ? (p) 00111 p h 1011 p l put p, dbf (p) ? dbf 00111 p h 1010 p l pc 10C0 ? addr, page ? 0 01100 addr addr branch br pc 10C0 ? addr, page ? 1 01101 @ar pc ? ar 00111 000 0100 0000 addr sp ? sp C 1, asr ? pc, pc 10C0 ? addr, page ? 0 11100 addr call @ar sp ? sp C 1, asr ? pc, pc ? ar 00111 000 0101 0000 subroutine ret pc ? asr, sp ? sp + 1 00111 000 1110 0000 retsk pc ? asr, sp ? sp + 1 and skip 00111 001 1110 0000 reti pc ? asr, intr ? intsk, sp ? sp + 1 00111 010 1110 0000 ei intef ? 1 00111 000 1111 0000 interrupt di intef ? 0 00111 001 1111 0000 stop s stop 00111 010 1111 s others halt h halt 00111 011 1111 h nop no operation 00111 100 1111 0000 21.4 assembler (as17k) embedded macroinstructions legend flag n : flg type symbol < > : item in < > can be omitted. mnemonic operand operation n sktn flag 1, ...flag n if (flag 1) to (flag n) = all 1, then skip 1 n 4 skfn flag 1, ...flag n if (flag 1) to (flag n) = all 0, then skip 1 n 4 setn flag 1, ...flag n (flag 1) to (flag n) ? 11 n 4 embedded clrn flag 1, ...flag n (flag 1) to (flag n) ? 01 n 4 macro notn flag 1, ...flag n if (flag n) = 0, then (flag n) ? 1 1 n 4 if (flag n) = 1, then (flag n) ? 0 initflg flag 1, if description = not flag n, then (flag n) ? 0 1 n 4 ... < flag n> if description = flag n, then (flag n) ? 1
m pd17072,17073 208 22. m pd17073 reserved words 22.1 data buffer (dbf) symbol name attribute value r/w description dbf3 mem 0.0ch r/w bits 15-12 of dbf dbf2 mem 0.0dh r/w bits 11-8 of dbf dbf1 mem 0.0eh r/w bits 7-4 of dbf dbf0 mem 0.0fh r/w bits 3-0 of dbf 22.2 system register (sysreg) symbol name attribute value r/w description ar3 mem 0.74h r bits 15-12 of address register (fixed to 0) ar2 mem 0.75h r/w bits 11-8 of address register ar1 mem 0.76h r/w bits 7-4 of address register ar0 mem 0.77h r/w bits 3-0 of address register wr mem 0.78h r window register (fixed to 0) bank mem 0.79h r/w bank register (only lower 1 bit is valid) ixh mem 0.7ah r index register, high mph mem 0.7ah r memory pointer, high mpe flg 0.7ah.3 r memory pointer enable flag ixm mem 0.7bh r index register, middle (fixed to 0) mpl mem 0.7bh r memory pointer, low ixl mem 0.7ch r index register, low rph mem 0.7dh r general register pointer, high rpl mem 0.7eh r/w general register pointer, low (only lower 1 bit is valid) psw mem 0.7fh r/w program status word bcd flg 0.7eh.0 r/w bcd operation flag cmp flg 0.7fh.3 r/w compare flag cy flg 0.7fh.2 r/w carry flag z flg 0.7fh.1 r/w zero flag ixe flg 0.7fh.0 r index enable flag (fixed to 0)
m pd17072,17073 209 22.3 lcd segment register symbol name attribute value r/w description lcdd14 mem 1.41h r/w lcd segment register lcdd13 mem 1.42h r/w lcdd12 mem 1.43h r/w lcdd11 mem 1.44h r/w lcdd10 mem 1.45h r/w lcdd9 mem 1.46h r/w lcdd8 mem 1.47h r/w lcdd7 mem 1.48h r/w lcdd6 mem 1.49h r/w lcdd5 mem 1.4ah r/w lcdd4 mem 1.4bh r/w lcdd3 mem 1.4ch r/w lcdd2 mem 1.4dh r/w lcdd1 mem 1.4eh r/w lcdd0 mem 1.4fh r/w
m pd17072,17073 210 22.4 port register symbol name attribute value r/w description p0a3 flg 0.70.3 r/w bit 3 of port 0a p0a2 flg 0.70h.2 r/w bit 2 of port 0a p0a1 flg 0.70h.1 r/w bit 1 of port 0a p0a0 flg 0.70h.0 r/w bit 0 of port 0a p0b3 flg 0.71h.3 r/w bit 3 of port 0b p0b2 flg 0.71h.2 r/w bit 2 of port 0b p0b1 flg 0.71h.1 r/w bit 1 of port 0b p0b0 flg 0.71h.0 r/w bit 0 of port 0b p0c1 flg 0.72h.1 r/w bit 1 of port 0c p0c0 flg 0.72h.0 r/w bit 0 of port 0c p0d3 flg 0.73h.3 r/w bit 3 of port 0d p0d2 flg 0.73h.2 r/w bit 2 of port 0d p1a3 flg 1.70h.3 r/w bit 3 of port 1a p1a2 flg 1.70h.2 r/w bit 2 of port 1a p1a1 flg 1.70h.1 r/w bit 1 of port 1a p1a0 flg 1.70h.0 r/w bit 0 of port 1a p1b3 flg 1.71h.3 r/w bit 3 of port 1b p1b2 flg 1.71h.2 r/w bit 2 of port 1b p1b1 flg 1.71h.1 r/w bit 1 of port 1b p1b0 flg 1.71h.0 r/w bit 0 of port 1b p1c0 flg 1.72h.0 r/w bit 0 of port 1c CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
m pd17072,17073 211 22.5 peripheral control register symbol name attribute value r/w description adcon flg 1.50h.1 r/w a/d converter control signal power setting flag lcden flg 1.50h.0 r/w lcd driver display start flag btm0cy flg 1.51h.0 r&res basic timer 0 carry ff status detection flag ce flg 1.52h.0 r ce pin status detection flag p1apld3 flg 1.53h.3 r/w p1a3 pin pull-down resistor select flag p1apld2 flg 1.53h.2 r/w p1a2 pin pull-down resistor select flag p1apld1 flg 1.53h.1 r/w p1a1 pin pull-down resistor select flag p1apld0 flg 1.53h.0 r/w p1a0 pin pull-down resistor select flag sp mem 1.54h r/w stack pointer sysck flg 1.55h.0 r/w system clock select flag int flg 1.56h.2 r/w int pin status detection flag btm1ck flg 1.56h.1 r/w basic timer 1 clock select flag ieg flg 1.56h.0 r/w int pin interrupt request detection edge direction select flag ipsio flg 1.57h.2 r/w serial interface interrupt enable flag ipbtm1 flg 1.57h.1 r/w basic timer 1 interrupt enable flag ip flg 1.57h.0 r/w int pin interrupt enable flag irq flg 1.58h.0 r/w int pin interrupt request detection flag irqbtm1 flg 1.59h.0 r/w basic timer 1 interrupt request detection flag irqsio flg 1.5ah.0 r/w serial interface interrupt request detection flag beep0ck1 flg 1.5bh.1 r/w beep clock select flag beep0ck0 flg 1.5bh.0 r/w adcch3 flgq 1.5ch.3 r a/d converter channel select flag (fixed to 0) adcch2 flg 1.5ch.2 r adcch1 flg 1.5ch.1 r/w a/d converter channel select flag adcch0 flg 1.5ch.0 r/w adcrfsel3 flg 1.5dh.3 r/w a/d converter reference voltage setting flag adcrfsel2 flg 1.5dh.2 r/w adcrfsel1 flg 1.5dh.1 r/w adcrfsel0 flg 1.5dh.0 r/w adcstrt flg 1.5eh.0 r/w a/d converter compare start flag adccmp flg 1.5fh.0 r a/d converter compare result detection flag siosel flg 1.60h.2 r/w serial in/serial out pin select flag siohiz flg 1.60h.1 r/w serial interface/general-purpose port select flag siots flg 1.60h.0 r/w serial interface transmit/receive start flag siock3 flg 1.61h.3 r serial interface i/o clock select flag (fixed to 0) siock2 flg 1.61h.2 r siock0 flg 1.61h.1 r/w serial interface i/o clock select flag siock0 flg 1.61h.0 r/w ifcmd1 flg 1.62h.3 r/w if counter mode select flag (10, 11: amif) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
m pd17072,17073 212 symbol name attribute value r/w description ifcmd0 flg 1.62h.2 r/w if counter mode select flag (00: general-purpose i/o port, 01: fmif) incck1 flg 1.62h.1 r/w if counter clock select flag ifcck0 flg 1.62h.0 r/w ifcg flg 1.63h.0 r if counter gate status detection flag (1: open, 0: close) ifcstrt flg 1.64h.1 w if counter count start flag ifcres flg 1.64h.0 w if counter reset flag pllmd3 flg 1.65h.3 r pll mode select flag (fixed to 0) pllmd2 flg 1.65h.2 r pllmd1 flg 1.65h.1 r/w pll mode select flag pllmd0 flg 1.65h.0 r/w pllrfck3 flg 1.66h.3 r pll reference frequency select flag (fixed to 0) pllrfck2 flg 1.66h.2 r/w pll reference frequency select flag pllrfck1 flg 1.66h.1 r/w pllrfck0 flg 1.66h.0 r/w pllr17 flg 1.67h.3 r/w pll data flag pllr16 flg 1.67h.2 r/w pllr15 flg 1.67h.1 r/w pllr14 flg 1.67h.0 r/w pllr13 flg 1.68h.3 r/w pllr12 flg 1.68h.2 r/w pllr11 flg 1.68h.1 r/w pllr10 flg 1.68h.0 r/w pllr9 flg 1.69h.3 r/w pllr8 flg 1.69h.2 r/w pllr7 flg 1.69h.1 r/w pllr6 flg 1.69h.0 r/w pllr5 flg 1.6ah.3 r/w pllr4 flg 1.6ah.2 r/w pllr3 flg 1.6ah.1 r/w pllr2 flg 1.6ah.0 r/w pllr1 flg 1.6bh.3 r/w pllput flg 1.6ch.0 w pll data set flag pllul flg 1.6dh.0 r&res pll unlock ff flag p0bbio3 flg 1.6eh.3 r/w p0b3 input/output select flag p0bbio2 flg 1.6eh.2 r/w p0b2 input/output select flag p0bbio1 flg 1.6eh.1 r/w p0b1 input/output select flag p0bbio0 flg 1.6eh.0 r/w p0b0 input/output select flag p0dbio3 flg 1.6fh.3 r/w p0d3 input/output select flag p0dbio2 flg 1.6fh.2 r/w p0d2 input/output select flag p0cbio1 flg 1.6fh.1 r/w p0c1 input/output select flag p0cbio0 flg 1.6fh.0 r/w p0c0 input/output select flag CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
m pd17072,17073 213 22.6 peripheral hardware register symbol name attribute value r/w description siosfr dat 03h r/w serial interface presettable shift register ar dat 40h r/w address register of get/put/push/call/br/movt instruction ifc dat 43h r intermediate frequency (if) counter data register 22.7 others symbol name attribute value description dbf dat 0fh fixed operand value of put, get, and movt instructions
m pd17072,17073 214 23. electrical characteristics absolute maximum ratings (t a = 25 c) parameter symbol condition rating unit supply voltage v dd C0.3 to +4.0 v input voltage v i ce pin C0.3 to v dd +0.6 v other than ce pin C0.3 to v dd +0.3 v output voltage v o C0.3 to v dd +0.3 v output current, high f oh 1 pin C3.0 ma total of all pins C20.0 ma output current, low i ol 1 pin 3.0 ma total of all pins 20.0 ma operating ambient temperature t a C20 to +70 c storage temperature t stg C55 to +125 c caution if the absolute maximum rating of even one of the above parameters is exceeded even momentarily, the quality of the product may be degraded. in other words, the absolute maximum ratings specify the values exceeding which the product may be physically damaged. be sure to use the product with these ratings never exceeded. recommended operating range parameter symbol condition min. typ. max. unit supply voltage v dd1 with cpu, pll, and ad operating 1.8 3.0 3.6 v t a = C20 to +70 c v dd2 with cpu operating and t a = C10 to +70 c 1.7 3.0 3.6 v pll and ad stopped t a = 0 to +70 c 1.6 3.0 3.6 v supply voltage rise time t rise v dd : 0 ? 1.8 v 500 ms
m pd17072,17073 215 dc characteristics (t a = e20 to +70 c, v dd = 1.8 to 3.6 v) parameter symbol condition min. typ. max. unit supply voltage v dd1 with cpu, pll, and ad operating 1.8 3.0 3.6 v t a = C20 to +70 c v dd2 with cpu operating, t a = C10 to +70 c 1.7 3.0 3.6 v and pll and ad stopped t a = 0 to +70 c 1.6 3.0 3.6 v supply current i dd1 with cpu and pll operating 6.5 10 ma sine wave input to vcoh pin (f in = 230 mhz, v in = 0.2 v p-p ) v dd = 3 v, t a = 25 c i dd2 with cpu operating and pll stopped 35 45 m a (if counter stopped) sine wave input to x in pin (f in = 75 khz, v in = v dd ) v dd = 3 v, t a = 25 c i dd3 with cpu and pll stopped 10 18 m a (with halt instruction used) sine wave input to x in pin (f in = 75 khz, v in = v dd ) lcd display off, v dd = 3 v, t a = 25 c data retention voltage v ddr on power failure detection 1.7 v data retention current i ddr when crystal oscillation stopped 3 m a t a = 25 c, v dd = 3.0 v input voltage, high v ih1 ce, int, p0b0-p0b3, p0c0, p0c1, p0d2, p0d3 0.8 v dd v v ih2 p1a0-p1a3 0.5 v dd v input voltage, low v il1 ce, int, p0b0-p0b3, p0c0, p0c1, p0d2, p0d3 0.2 v dd v v il2 p1a0-p1a3 0.05 v dd v output current, high i oh1 p0a0-p0a3, p0b0-p0b3, p1b0-p1b3, p0c0, C0.5 ma p0c1, p0d2, p0d3, p1c0, beep v oh = v dd C 0.5 v i oh2 eo v oh = v dd C 0.5 v C0.2 ma i oh3 lcd0-lcd14 v oh = v dd C 0.5 v C20 m a output current, low i ol1 p0a0-p0a3, p0b0-p0b3, p0c0, p0c1, p0d2, 0.5 ma p0d3, p1c0, beep v ol = 0.5 v i ol2 eo v ol = 0.5 v 0.2 ma i ol3 p1b0-p1b3 v ol = 0.5 v 5 m a i ol4 lcd0-lcd14 v ol = 0.5 v 20 m a input current, high i ih1 with p1a0-p1a3 pulled down 3 30 m a v ih = v dd = 1.8 v i ih2 with x in pulled down 40 m a v ih = v dd = 1.8 v lcd drive voltage v lcd1 with lcd0-lcd14 output open 2.8 3.1 3.3 v c 1 = 0.1 m f, c 2 = 0.01 m f t a = 25 c output off leakage current i l eo 1 m a
m pd17072,17073 216 ac characteristics (t a = e20 to +70 c, v dd = 1.8 to 3.6 v) parameter symbol condition min. typ. max. unit operating frequency f in1 vcol pin, mf mode 0.3 8 mhz sine wave input, v in = 0.2 v p-p f in2 vcol pin, hf mode 5 130 mhz sine wave input, v in = 0.3 v p-p f in3 vcoh pin, vhf mode 40 230 mhz sine wave input, v in = 0.2 v p-p f in4 amifc pin, fmifc pin, amif count mode 400 500 khz sine wave input, v in = 0.1 v p-p f in5 amifc pin, fmifc pin, amif count mode 0.4 2 mhz sine wave input, v in = 0.15 v p-p f in6 fmifc pin, fmif count mode 10 11 mhz sine wave input, v in = 0.1 v p-p a/d converter characteristics (t a = 25 c, v dd = 1.8 v) parameter symbol condition min. typ. max. unit a/d converter 4-bit resolution 1.5 lsb
m pd17072,17073 217 24. package drawings 56 pin plastic qfp (10 10) item millimeters inches d f g k i j 0.8 0.8 1.4?.2 0.65 (t.p.) 0.13 12.8?.4 q 0.504?.016 0.031 0.031 0.055?.008 0.005 0.026 (t.p.) s56gb-65-1a7-3 note each lead centerline is located within 0.13 mm (0.005 inch) of its true position (t.p.) at maximum material condition. c 10.0?.2 0.394?.008 m 0.15 0.006 0.125?.075 0.005?.003 +0.004 ?.003 a 12.8?.4 0.504?.016 h 0.30?.10 0.012?.004 l 0.6?.2 0.024 +0.008 ?.009 n 0.10 0.004 p 1.7 0.067 s r 2.0 max. 5 5 0.079 max. 5 5 +0.10 e0.05 b 10.00.2 0.3940.008 n detail of lead end i j f g h q r p k m l m 42 43 28 56 1 15 14 29 a b cd s
m pd17072,17073 218 64 pin plastic tqfp (fine pitch) ( 10) item millimeters inches i j 0.5 (t.p.) 0.10 0.004 0.020 (t.p.) a note each lead centerline is located within 0.10 mm (0.004 inch) of its true position (t.p.) at maximum material condition. s a 12.0?.2 0.472 +0.009 ?.008 b 10.0?.2 0.394 +0.008 ?.009 c 10.0?.2 0.394 +0.008 ?.009 d 12.0?.2 0.472 +0.009 ?.008 f g 1.25 1.25 0.049 0.049 h 0.22 0.009?.002 s64gb-50-9eu-1 s 1.27 max. 0.050 max. k 1.0?.2 0.039 +0.009 ?.008 l 0.5?.2 0.020 +0.008 ?.009 m 0.145 0.006?.002 n 0.10 0.004 p 1.0?.1 0.039 +0.005 ?.004 q 0.1?.05 0.004?.002 +0.055 ?.045 +0.055 ?.045 b c d j h i g f p n l k m q r r3 3 +7 ? +7 ? detail of lead end m 48 32 33 64 1 17 16 49
m pd17072,17073 219 25. recommended soldering conditions solder the m pd17073 under the following recommended conditions. for the details of the recommended soldering conditions, refer to information document semiconductor device mounting technology manual (c10535e) . for the soldering methods and conditions other than those recommended, consult nec. table 25-1. soldering conditions for surface-mount type (1) m pd17072gb- -1a7: 56-pin plastic qfp (10 10 mm, 0.65-mm pitch) m pd17073gb- -1a7: 56-pin plastic qfp (10 10 mm, 0.65-mm pitch) soldering method soldering condition symbol of recommended soldering infrared reflow package peak temperature: 235 c, time: 30 seconds max. (210 c min.) ir35-00-2 number of times: 2 max. vps package peak temperature: 215 c, time: 40 seconds max. (200 c min.) vp15-00-2 number of times: 2 max. wave soldering soldering bath temperature: 260 c max., time: 10 seconds max., ws60-00-1 number of times: 1, preheating temperature: 120 c max. (package surface temperature) pin partial heating pin temperature: 300 c max., time: 3 seconds max. (per side of device) (2) m pd17072gb- -9eu: 64-pin plastic tqfp (10 10 mm, 0.5-mm pitch) m pd17073gb- -9eu: 64-pin plastic tqfp (10 10 mm, 0.5-mm pitch) soldering method soldering condition symbol of recommended soldering infrared reflow package peak temperature: 235 c, time: 30 seconds max. (210 c min.) ir35-102-1 number of times: 1, number of days: 2 note (after that, prebaking at 125 c for 10 hours is necessary) vps package peak temperature: 215 c, time: 40 seconds max. (200 c min.) vp15-102-1 number of times: 1, number of days: 2 note (after that, prebaking at 125 c for 10 hours is necessary) pin partial heating pin temperature: 300 c max., time: 3 seconds (per side of device) note the number of days for which the device can be stored after the dry pack is opened, at 25 c, 65%rh max. caution do not use two or more soldering methods in combination (except pin partial heating).
m pd17072,17073 220 appendix a. notes on connecting crystal resonator when connecting a crystal resonator to the m pd17073, connect the part enclosed by dotted line in figure a-1 below as follows to avoid adverse influence of wiring capacitance: ? keep the wiring length as short as possible. ? do not cross the wiring with any other signal lines. do not route the wiring in the vicinity of lines through which a high current flows. ? the ground of the capacitors of the oscillation circuit must be always at the same potential as gnd. do not ground to a ground pattern through which a high current flows. ? do not extract signals from the oscillation circuit. to connect the capacitors or to adjust the oscillation frequency, keep in mind the following points (1) through (3): (1) if the values of c1 and c2 are too high, the oscillation characteristics may be degraded or the current consumption increases. (2) a trimmer capacitor for oscillation frequency adjustment is generally connected to the x in pin. depending on the crystal resonator to be used, however, the oscillation stability may be degraded as a result of connecting a trimmer capacitor to the x in pin (in this case, connect the trimmer capacitor to the x out pin). therefore, evaluate oscillation by using the crystal resonator to be actually used. (3) adjust the oscillation frequency while measuring the lcd drive waveform (62.5 hz) or vco oscillation frequency. if a probe is connected to the x out or x in pin, accurate adjustment cannot be made due to the capacitance of the probe. figure a-1. connecting crystal resonator m x out x in 75 khz crystal resonator c1 pd17073 c2
m pd17072,17073 221 appendix b. development tools the following development tools are available for development of the program of the m pd17073: hardware name outline in-circuit emulator ie-17k, ie-17k-et, and emu-17k are in-circuit emulators common to 17k series. [ie-17k, ie-17k-et note1 , ie-17k and ie-17k-et are connected to host machine such as pc-9800 series or ibm pc/at tm emu-17k note2 ] with rs-232-c. emu-17k is mounted in expansion slot of host machine, pc-9800 series. by using these in-circuit emulators in combination with system evaluation board (se board) dedicated to each model of microcontroller, they operate as emulators dedicated to that microcontroller. when simplehost ? , which is man-machine interface, is used, more sophisticated debugging environment can be created. emu-17k also has function that allows you to monitor contents of data memory real-time. se board (se-17072) se-17072 is se board for m pd17072 and 17073. it may be used alone to evaluate system, or in combination with in-circuit emulator for debugging. emulation probe ep-17k56gb is an emulation probe for the 17k series 56-pin qfp (10 10 mm). by using (ep-17k56gb) this emulation probe with the ev-9500gb-56 note 3 , the se board and target system are connected. ep-17k56gb-1: bend lead package ep-17k56gb-2: inverted lead package emulation probe ep-17k64gb is an emulation probe for the 17k series 64-pin tqfp (10 10 mm). by using (ep-17k64gb: this emulation probe with the ev-9500gb-64 note 3 , the se board and target system are connected. bend lead package) conversion adapter ev-9500gb-56 is a conversion adapter for a 56-pin qfp (10 10 mm). (ev-9500gb-56) it is used to connect the ep-17k56gb and target system. conversion adapter ev-9500gb-64 is a conversion adapter for a 64-pin tqfp (10 10 mm). (ev-9500gb-64) it is used to connect the ep-17k64gb and target system. notes 1. low-cost model: external power supply type 2. this is a product from i.c. for details, contact i.c corp. ((03) 3447-3793). 3. one ev-9500gb-56 is supplied with the ep-17k56gb. five ev-9500gb-56 are also available as a set. one ev-9500gb-64 is supplied with the ep-17k64gb. five ev-9500gb-64 are also available as a set.
m pd17072,17073 222 17k-series assembler (as17k) device file (as17071) support software ( simplehost ) software ms-dos tm pc dos tm ms-dos pc dos ms-dow windows pc dos name outline host machine os supply media order code pc-9800 series ibm pc/at pc-9800 series ibm pc/at pc-9800 series ibm pc/at 5"2hd m s5a10as17k 3.5"2hd m s5a13as17k 5"2hc m s7b10as17k 3.5"2hc m s7b13as17k 5"2hd m s5a10as17071 3.5"2hd m s5a13as17071 5"2hc m s7b10as17071 3.5"2hc m s7b13as17071 5"2hd m s5a10ie17k 3.5"2hd m s5a13ie17k 5"2hc m s7b10ie17k 3.5"2hc m s7b13ie17k as17k is an assembler that can be commonly used with the 17k series products. to develop the program of the m pd17072 and 17073, as17k and a device file (as17071) are used. as17071 is a device file for m pd17072 and 17073, and is used with 17k series assembler (as17k). simplehost is software that serves as a man-machine interface on windows tm when a program is developed with an in-circuit emulator and a personal computer. remark supported os versions are listed below. os version ms-dos ver. 3.30 to ver. 5.00a note pc dos ver. 3.1 to ver. 5.0 note windows ver. 3.0 to ver. 3.1 note ver. 5.00/5.00a of ms-dos and ver. 5.0 of pc dos have a task swap function, but it is not supported by this software product.
m pd17072,17073 223 [memo]
m pd17072,17073 224 notes for cmos devices 1 precaution against esd for semiconductors note: strong electric field, when exposed to a mos device, can cause destruction of the gate oxide and ultimately degrade the device operation. steps must be taken to stop generation of static electricity as much as possible, and quickly dissipate it once, when it has occurred. environmental control must be adequate. when it is dry, humidifier should be used. it is recommended to avoid using insulators that easily build static electricity. semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. all test and measurement tools including work bench and floor should be grounded. the operator should be grounded using wrist strap. semiconductor devices must not be touched with bare hands. similar precautions need to be taken for pw boards with semiconductor devices on it. 2 handling of unused input pins for cmos note: no connection for cmos device inputs can be cause of malfunction. if no connection is provided to the input pins, it is possible that an internal input level may be generated due to noise, etc., hence causing malfunction. cmos device behave differently than bipolar or nmos devices. input levels of cmos devices must be fixed high or low by using a pull-up or pull-down circuitry. each unused pin should be connected to v dd or gnd with a resistor, if it is considered to have a possibility of being an output pin. all handling related to the unused pins must be judged device by device and related specifications governing the devices. 3 status before initialization of mos devices note: power-on does not necessarily define initial status of mos device. produc- tion process of mos does not define the initial operation status of the device. immediately after the power source is turned on, the devices with reset function have not yet been initialized. hence, power-on does not guarantee out-pin levels, i/o settings or contents of registers. device is not initialized until the reset signal is received. reset operation must be executed imme- diately after power-on for devices having reset function.
m pd17072,17073 225 nec electronics inc. (u.s.) mountain view, california tel: 800-366-9782 fax: 800-729-9288 nec electronics (germany) gmbh duesseldorf, germany tel: 0211-65 03 02 fax: 0211-65 03 490 nec electronics (uk) ltd. milton keynes, uk tel: 01908-691-133 fax: 01908-670-290 nec electronics italiana s.r.1. milano, italy tel: 02-66 75 41 fax: 02-66 75 42 99 nec electronics hong kong ltd. hong kong tel: 2886-9318 fax: 2886-9022/9044 nec electronics hong kong ltd. seoul branch seoul, korea tel: 02-528-0303 fax: 02-528-4411 nec electronics singapore pte. ltd. united square, singapore 1130 tel: 253-8311 fax: 250-3583 nec electronics taiwan ltd. taipei, taiwan tel: 02-719-2377 fax: 02-719-5951 nec do brasil s.a. sao paulo-sp, brasil tel: 011-889-1680 fax: 011-889-1689 nec electronics (germany) gmbh benelux office eindhoven, the netherlands tel: 040-2445845 fax: 040-2444580 nec electronics (france) s.a. france tel: 01-30-67 58 00 fax: 01-30-67 58 99 nec electronics (france) s.a. spain office madrid, spain tel: 01-504-2787 fax: 01-504-2860 nec electronics (germany) gmbh scandinavia office taeby sweden tel: 8-63 80 820 fax: 8-63 80 388 regional information some information contained in this document may vary from country to country. before using any nec product in your application, please contact the nec office in your country to obtain a list of authorized representatives and distributors. they will verify: ? device availability ? ordering information ? product release schedule ? availability of related technical literature ? development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, ac supply voltages, and so forth) ? network requirements in addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. j96. 3
m pd17072,17073 226 no part of this document may be copied or reproduced in any form or by any means without the prior written consent of nec corporation. nec corporation assumes no responsibility for any errors which may appear in this document. nec corporation does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device. no license, either express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of nec corporation or others. while nec corporation has been making continuous effort to enhance the reliability of its semiconductor devices, the possibility of defects cannot be eliminated entirely. to minimize risks of damage or injury to persons or property arising from a defect in an nec semiconductor device, customers must incorporate sufficient safety measures in its design, such as redundancy, fire-containment, and anti-failure features. nec devices are classified into the following three quality grades: "standard", "special", and "specific". the specific quality grade applies only to devices developed based on a customer designated "quality assurance program" for a specific application. the recommended applications of a device depend on its quality grade, as indicated below. customers must check the quality grade of each device before using it in a particular application. standard: computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots special: transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support) specific: aircrafts, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems or medical equipment for life support, etc. the quality grade of nec devices is "standard" unless otherwise specified in nec's data sheets or data books. if customers intend to use nec devices for applications other than those specified for standard quality grade, they should contact an nec sales representative in advance. anti-radioactive design is not implemented in this product. m4 96.5 the export of this product from japan is regulated by the japanese government. to export this product may be prohibited without governmental license, the need for which must be judged by the customer. the export or re-export of this product from a country other than japan may also be prohibited without a license from that country. please call an nec sales representative. simplehost is a registerd trademark of nec corporation. pc/at and pc dos are trademarks of ibm corporation. ms-dos and windows are trademarks of microsoft corporation.


▲Up To Search▲   

 
Price & Availability of UPD17072GB-XXX-1A7

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X